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() */
136 * need RCU to access ->real_parent if CLONE_VM was used along with in in_vfork()
139 * We check real_parent->mm == tsk->mm because CLONE_VFORK does not in in_vfork()
143 * ->real_parent is not necessarily the task doing vfork(), so in in in_vfork()
146 * And in this case we can't trust the real_parent->mm == tsk->mm in in_vfork()
148 * another oom-unkillable task does this it should blame itself. in in_vfork()
151 ret = tsk->vfork_done && in in_vfork()
152 rcu_dereference(tsk->real_parent)->mm == tsk->mm; in in_vfork()
159 * Applies per-task gfp context to the given allocation flags.
165 unsigned int pflags = READ_ONCE(current->flags); in current_gfp_context()
193 * memalloc_noio_save - Marks implicit GFP_NOIO allocation scope.
205 unsigned int flags = current->flags & PF_MEMALLOC_NOIO; in memalloc_noio_save()
206 current->flags |= PF_MEMALLOC_NOIO; in memalloc_noio_save()
211 * memalloc_noio_restore - Ends the implicit GFP_NOIO scope.
220 current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; in memalloc_noio_restore()
224 * memalloc_nofs_save - Marks implicit GFP_NOFS allocation scope.
236 unsigned int flags = current->flags & PF_MEMALLOC_NOFS; in memalloc_nofs_save()
237 current->flags |= PF_MEMALLOC_NOFS; in memalloc_nofs_save()
242 * memalloc_nofs_restore - Ends the implicit GFP_NOFS scope.
251 current->flags = (current->flags & ~PF_MEMALLOC_NOFS) | flags; in memalloc_nofs_restore()
256 unsigned int flags = current->flags & PF_MEMALLOC; in memalloc_noreclaim_save()
257 current->flags |= PF_MEMALLOC; in memalloc_noreclaim_save()
263 current->flags = (current->flags & ~PF_MEMALLOC) | flags; in memalloc_noreclaim_restore()
269 unsigned int flags = current->flags & PF_MEMALLOC_NOCMA; in memalloc_nocma_save()
271 current->flags |= PF_MEMALLOC_NOCMA; in memalloc_nocma_save()
277 current->flags = (current->flags & ~PF_MEMALLOC_NOCMA) | flags; in memalloc_nocma_restore()
293 * set_active_memcg - Starts the remote memcg charging scope.
312 old = current->active_memcg; in set_active_memcg()
313 current->active_memcg = memcg; in set_active_memcg()
349 if (current->mm != mm) in membarrier_mm_sync_core_before_usermode()
351 if (likely(!(atomic_read(&mm->membarrier_state) & in membarrier_mm_sync_core_before_usermode()