Lines Matching defs:mm

20  * @mm: The &struct mm_struct to pin.
22 * Make sure that @mm will not get freed even after the owning task
27 * This is a preferred way to pin @mm for a longer/unbounded amount
32 * See also <Documentation/mm/active_mm.rst> for an in-depth explanation
35 static inline void mmgrab(struct mm_struct *mm)
37 atomic_inc(&mm->mm_count);
45 extern void __mmdrop(struct mm_struct *mm);
47 static inline void mmdrop(struct mm_struct *mm)
54 if (unlikely(atomic_dec_and_test(&mm->mm_count)))
55 __mmdrop(mm);
60 * RCU callback for delayed mm drop. Not strictly RCU, but call_rcu() is
65 struct mm_struct *mm = container_of(rhp, struct mm_struct, delayed_drop);
67 __mmdrop(mm);
74 static inline void mmdrop_sched(struct mm_struct *mm)
77 if (atomic_dec_and_test(&mm->mm_count))
78 call_rcu(&mm->delayed_drop, __mmdrop_delayed);
81 static inline void mmdrop_sched(struct mm_struct *mm)
83 mmdrop(mm);
87 /* Helpers for lazy TLB mm refcounting */
88 static inline void mmgrab_lazy_tlb(struct mm_struct *mm)
91 mmgrab(mm);
94 static inline void mmdrop_lazy_tlb(struct mm_struct *mm)
97 mmdrop(mm);
107 static inline void mmdrop_lazy_tlb_sched(struct mm_struct *mm)
110 mmdrop_sched(mm);
117 * @mm: The address space to pin.
128 * See also <Documentation/mm/active_mm.rst> for an in-depth explanation
131 static inline void mmget(struct mm_struct *mm)
133 atomic_inc(&mm->mm_users);
136 static inline bool mmget_not_zero(struct mm_struct *mm)
138 return atomic_inc_not_zero(&mm->mm_users);
150 /* Grab a reference to a task's mm, if it is not already going away */
153 * Grab a reference to a task's mm, if it is not already going away
164 extern void mm_update_next_owner(struct mm_struct *mm);
166 static inline void mm_update_next_owner(struct mm_struct *mm)
180 extern void arch_pick_mmap_layout(struct mm_struct *mm,
190 unsigned long mm_get_unmapped_area(struct mm_struct *mm, struct file *filp,
203 unsigned long mm_get_unmapped_area_vmflags(struct mm_struct *mm,
220 static inline void arch_pick_mmap_layout(struct mm_struct *mm,
232 * We check real_parent->mm == tsk->mm because CLONE_VFORK does not
239 * And in this case we can't trust the real_parent->mm == tsk->mm
245 rcu_dereference(tsk->real_parent)->mm == tsk->mm;
548 static inline void membarrier_mm_sync_core_before_usermode(struct mm_struct *mm)
550 if (current->mm != mm)
552 if (likely(!(atomic_read(&mm->membarrier_state) &
558 extern void membarrier_exec_mmap(struct mm_struct *mm);
570 static inline void membarrier_exec_mmap(struct mm_struct *mm)
573 static inline void membarrier_mm_sync_core_before_usermode(struct mm_struct *mm)