Lines Matching refs:mm
61 struct mm_struct *mm; in find_other_mm() local
68 mm = ts->mm; in find_other_mm()
69 if (mm == NULL) in find_other_mm()
72 if (atomic_inc_not_zero(&mm->mm_users)) in find_other_mm()
73 return (mm); in find_other_mm()
83 struct mm_struct *mm, *mm_other; in linux_alloc_current() local
98 mm = NULL; in linux_alloc_current()
119 mm = uma_zalloc(linux_mm_zone, flags | M_ZERO); in linux_alloc_current()
120 if (mm == NULL) { in linux_alloc_current()
124 uma_zfree(linux_current_zone, mm); in linux_alloc_current()
132 init_rwsem(&mm->mmap_sem); in linux_alloc_current()
133 atomic_set(&mm->mm_count, 1); in linux_alloc_current()
134 atomic_set(&mm->mm_users, 1); in linux_alloc_current()
136 ts->mm = mm; in linux_alloc_current()
138 mm = NULL; in linux_alloc_current()
140 ts->mm = mm_other; in linux_alloc_current()
143 ts->mm = mm_other; in linux_alloc_current()
151 uma_zfree(linux_mm_zone, mm); in linux_alloc_current()
159 struct mm_struct *mm; in linux_get_task_mm() local
161 mm = task->mm; in linux_get_task_mm()
162 if (mm != NULL) { in linux_get_task_mm()
163 atomic_inc(&mm->mm_users); in linux_get_task_mm()
164 return (mm); in linux_get_task_mm()
170 linux_mm_dtor(struct mm_struct *mm) in linux_mm_dtor() argument
172 uma_zfree(linux_mm_zone, mm); in linux_mm_dtor()
178 mmput(ts->mm); in linux_free_current()