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 && tsk->real_parent->mm == tsk->mm; in in_vfork()
150 * Applies per-task gfp context to the given allocation flags.
156 unsigned int pflags = READ_ONCE(current->flags); in current_gfp_context()
184 * memalloc_noio_save - Marks implicit GFP_NOIO allocation scope.
196 unsigned int flags = current->flags & PF_MEMALLOC_NOIO; in memalloc_noio_save()
197 current->flags |= PF_MEMALLOC_NOIO; in memalloc_noio_save()
202 * memalloc_noio_restore - Ends the implicit GFP_NOIO scope.
211 current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; in memalloc_noio_restore()
215 * memalloc_nofs_save - Marks implicit GFP_NOFS allocation scope.
227 unsigned int flags = current->flags & PF_MEMALLOC_NOFS; in memalloc_nofs_save()
228 current->flags |= PF_MEMALLOC_NOFS; in memalloc_nofs_save()
233 * memalloc_nofs_restore - Ends the implicit GFP_NOFS scope.
242 current->flags = (current->flags & ~PF_MEMALLOC_NOFS) | flags; in memalloc_nofs_restore()
247 unsigned int flags = current->flags & PF_MEMALLOC; in memalloc_noreclaim_save()
248 current->flags |= PF_MEMALLOC; in memalloc_noreclaim_save()
254 current->flags = (current->flags & ~PF_MEMALLOC) | flags; in memalloc_noreclaim_restore()
260 unsigned int flags = current->flags & PF_MEMALLOC_NOCMA; in memalloc_nocma_save()
262 current->flags |= PF_MEMALLOC_NOCMA; in memalloc_nocma_save()
268 current->flags = (current->flags & ~PF_MEMALLOC_NOCMA) | flags; in memalloc_nocma_restore()
284 * set_active_memcg - Starts the remote memcg charging scope.
303 old = current->active_memcg; in set_active_memcg()
304 current->active_memcg = memcg; in set_active_memcg()
340 if (current->mm != mm) in membarrier_mm_sync_core_before_usermode()
342 if (likely(!(atomic_read(&mm->membarrier_state) & in membarrier_mm_sync_core_before_usermode()