mm: delete unused MMF_OOM_VICTIM flag
commit b3541d912a84dc40cabb516f2deeac9ae6fa30da Author: Suren Baghdasaryan <surenb@google.com> Date: Tue May 31 15:31:00 2022 -0700 mm: delete unused MMF_OOM_VICTIM flag With the last usage of MMF_OOM_VICTIM in exit_mmap gone, this flag is now unused and can be removed. [akpm@linux-foundation.org: remove comment about now-removed mm_is_oom_victim()] Link: https://lkml.kernel.org/r/20220531223100.510392-2-surenb@google.com Signed-off-by: Suren Baghdasaryan <surenb@google.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: David Rientjes <rientjes@google.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Roman Gushchin <guro@fb.com> Cc: Minchan Kim <minchan@kernel.org> Cc: "Kirill A . Shutemov" <kirill@shutemov.name> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Christian Brauner (Microsoft) <brauner@kernel.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: David Hildenbrand <david@redhat.com> Cc: Jann Horn <jannh@google.com> Cc: Shakeel Butt <shakeelb@google.com> Cc: Peter Xu <peterx@redhat.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Liam Howlett <liam.howlett@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168372 Signed-off-by: Nico Pache <npache@redhat.com>
This commit is contained in:
parent
a1e8cb93bf
commit
db3644c677
|
@ -77,15 +77,6 @@ static inline bool tsk_is_oom_victim(struct task_struct * tsk)
|
||||||
return tsk->signal->oom_mm;
|
return tsk->signal->oom_mm;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Use this helper if tsk->mm != mm and the victim mm needs a special
|
|
||||||
* handling. This is guaranteed to stay true after once set.
|
|
||||||
*/
|
|
||||||
static inline bool mm_is_oom_victim(struct mm_struct *mm)
|
|
||||||
{
|
|
||||||
return test_bit(MMF_OOM_VICTIM, &mm->flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Checks whether a page fault on the given mm is still reliable.
|
* Checks whether a page fault on the given mm is still reliable.
|
||||||
* This is no longer true if the oom reaper started to reap the
|
* This is no longer true if the oom reaper started to reap the
|
||||||
|
|
|
@ -70,9 +70,8 @@ static inline int get_dumpable(struct mm_struct *mm)
|
||||||
#define MMF_UNSTABLE 22 /* mm is unstable for copy_from_user */
|
#define MMF_UNSTABLE 22 /* mm is unstable for copy_from_user */
|
||||||
#define MMF_HUGE_ZERO_PAGE 23 /* mm has ever used the global huge zero page */
|
#define MMF_HUGE_ZERO_PAGE 23 /* mm has ever used the global huge zero page */
|
||||||
#define MMF_DISABLE_THP 24 /* disable THP for all VMAs */
|
#define MMF_DISABLE_THP 24 /* disable THP for all VMAs */
|
||||||
#define MMF_OOM_VICTIM 25 /* mm is the oom victim */
|
#define MMF_OOM_REAP_QUEUED 25 /* mm was queued for oom_reaper */
|
||||||
#define MMF_OOM_REAP_QUEUED 26 /* mm was queued for oom_reaper */
|
#define MMF_MULTIPROCESS 26 /* mm is shared between processes */
|
||||||
#define MMF_MULTIPROCESS 27 /* mm is shared between processes */
|
|
||||||
/*
|
/*
|
||||||
* MMF_HAS_PINNED: Whether this mm has pinned any pages. This can be either
|
* MMF_HAS_PINNED: Whether this mm has pinned any pages. This can be either
|
||||||
* replaced in the future by mm.pinned_vm when it becomes stable, or grow into
|
* replaced in the future by mm.pinned_vm when it becomes stable, or grow into
|
||||||
|
@ -80,7 +79,7 @@ static inline int get_dumpable(struct mm_struct *mm)
|
||||||
* pinned pages were unpinned later on, we'll still keep this bit set for the
|
* pinned pages were unpinned later on, we'll still keep this bit set for the
|
||||||
* lifecycle of this mm, just for simplicity.
|
* lifecycle of this mm, just for simplicity.
|
||||||
*/
|
*/
|
||||||
#define MMF_HAS_PINNED 28 /* FOLL_PIN has run, never cleared */
|
#define MMF_HAS_PINNED 27 /* FOLL_PIN has run, never cleared */
|
||||||
#define MMF_DISABLE_THP_MASK (1 << MMF_DISABLE_THP)
|
#define MMF_DISABLE_THP_MASK (1 << MMF_DISABLE_THP)
|
||||||
|
|
||||||
#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
|
#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
|
||||||
|
|
|
@ -3127,8 +3127,7 @@ void exit_mmap(struct mm_struct *mm)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set MMF_OOM_SKIP to hide this task from the oom killer/reaper
|
* Set MMF_OOM_SKIP to hide this task from the oom killer/reaper
|
||||||
* because the memory has been already freed. Do not bother checking
|
* because the memory has been already freed.
|
||||||
* mm_is_oom_victim because setting a bit unconditionally is cheaper.
|
|
||||||
*/
|
*/
|
||||||
set_bit(MMF_OOM_SKIP, &mm->flags);
|
set_bit(MMF_OOM_SKIP, &mm->flags);
|
||||||
mmap_write_lock(mm);
|
mmap_write_lock(mm);
|
||||||
|
|
|
@ -764,10 +764,8 @@ static void mark_oom_victim(struct task_struct *tsk)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* oom_mm is bound to the signal struct life time. */
|
/* oom_mm is bound to the signal struct life time. */
|
||||||
if (!cmpxchg(&tsk->signal->oom_mm, NULL, mm)) {
|
if (!cmpxchg(&tsk->signal->oom_mm, NULL, mm))
|
||||||
mmgrab(tsk->signal->oom_mm);
|
mmgrab(tsk->signal->oom_mm);
|
||||||
set_bit(MMF_OOM_VICTIM, &mm->flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure that the task is woken up from uninterruptible sleep
|
* Make sure that the task is woken up from uninterruptible sleep
|
||||||
|
|
Loading…
Reference in New Issue