Lines Matching +full:protect +full:- +full:exec
1 /* SPDX-License-Identifier: GPL-2.0 */
18 * mmgrab() - Pin a &struct mm_struct.
31 * See also <Documentation/vm/active_mm.rst> for an in-depth explanation
36 atomic_inc(&mm->mm_count); in mmgrab()
46 * user-space, after storing to rq->curr. in mmdrop()
48 if (unlikely(atomic_dec_and_test(&mm->mm_count))) in mmdrop()
53 * mmget() - Pin the address space associated with a &struct mm_struct.
57 * go away. This does not protect against parts of the address space being
65 * See also <Documentation/vm/active_mm.rst> for an in-depth explanation
70 atomic_inc(&mm->mm_users); in mmget()
75 return atomic_inc_not_zero(&mm->mm_users); in mmget_not_zero()
78 /* mmput gets rid of the mappings and all user-space */
97 /* Remove the current tasks stale references to the old mm_struct on exec() */
128 * need RCU to access ->real_parent if CLONE_VM was used along with in in_vfork()
131 * We check real_parent->mm == tsk->mm because CLONE_VFORK does not in in_vfork()
135 * ->real_parent is not necessarily the task doing vfork(), so in in in_vfork()
138 * And in this case we can't trust the real_parent->mm == tsk->mm in in_vfork()
140 * another oom-unkillable task does this it should blame itself. in in_vfork()
143 ret = tsk->vfork_done && in in_vfork()
144 rcu_dereference(tsk->real_parent)->mm == tsk->mm; in in_vfork()
151 * Applies per-task gfp context to the given allocation flags.
158 unsigned int pflags = READ_ONCE(current->flags); in current_gfp_context()
189 * might_alloc - Mark possible allocation sites
205 * memalloc_noio_save - Marks implicit GFP_NOIO allocation scope.
217 unsigned int flags = current->flags & PF_MEMALLOC_NOIO; in memalloc_noio_save()
218 current->flags |= PF_MEMALLOC_NOIO; in memalloc_noio_save()
223 * memalloc_noio_restore - Ends the implicit GFP_NOIO scope.
232 current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; in memalloc_noio_restore()
236 * memalloc_nofs_save - Marks implicit GFP_NOFS allocation scope.
248 unsigned int flags = current->flags & PF_MEMALLOC_NOFS; in memalloc_nofs_save()
249 current->flags |= PF_MEMALLOC_NOFS; in memalloc_nofs_save()
254 * memalloc_nofs_restore - Ends the implicit GFP_NOFS scope.
263 current->flags = (current->flags & ~PF_MEMALLOC_NOFS) | flags; in memalloc_nofs_restore()
268 unsigned int flags = current->flags & PF_MEMALLOC; in memalloc_noreclaim_save()
269 current->flags |= PF_MEMALLOC; in memalloc_noreclaim_save()
275 current->flags = (current->flags & ~PF_MEMALLOC) | flags; in memalloc_noreclaim_restore()
280 unsigned int flags = current->flags & PF_MEMALLOC_PIN; in memalloc_pin_save()
282 current->flags |= PF_MEMALLOC_PIN; in memalloc_pin_save()
288 current->flags = (current->flags & ~PF_MEMALLOC_PIN) | flags; in memalloc_pin_restore()
294 * set_active_memcg - Starts the remote memcg charging scope.
313 old = current->active_memcg; in set_active_memcg()
314 current->active_memcg = memcg; in set_active_memcg()
350 if (current->mm != mm) in membarrier_mm_sync_core_before_usermode()
352 if (likely(!(atomic_read(&mm->membarrier_state) & in membarrier_mm_sync_core_before_usermode()