[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOUHufbysRjhX_AiFirjvWCR129t4_bELd1wFQG+fBsZpzhgYw@mail.gmail.com>
Date: Mon, 22 Aug 2022 16:33:51 -0600
From: Yu Zhao <yuzhao@...gle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Suren Baghdasaryan <surenb@...gle.com>,
Michal Hocko <mhocko@...e.com>,
David Rientjes <rientjes@...gle.com>,
Matthew Wilcox <willy@...radead.org>,
Johannes Weiner <hannes@...xchg.org>,
Roman Gushchin <guro@...com>, Minchan Kim <minchan@...nel.org>,
"Kirill A . Shutemov" <kirill@...temov.name>,
Andrea Arcangeli <aarcange@...hat.com>, brauner@...nel.org,
hch@...radead.org, oleg@...hat.com,
David Hildenbrand <david@...hat.com>,
Jann Horn <jannh@...gle.com>,
Shakeel Butt <shakeelb@...gle.com>,
Peter Xu <peterx@...hat.com>,
John Hubbard <jhubbard@...dia.com>, shuah@...nel.org,
linux-kernel <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>, linux-kselftest@...r.kernel.org,
kernel-team@...roid.com
Subject: Re: [PATCH RESEND v2 2/2] mm: delete unused MMF_OOM_VICTIM flag
On Mon, Aug 22, 2022 at 4:21 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Tue, 31 May 2022 15:31:00 -0700 Suren Baghdasaryan <surenb@...gle.com> wrote:
>
> > With the last usage of MMF_OOM_VICTIM in exit_mmap gone, this flag is
> > now unused and can be removed.
> >
> > ...
> >
> > --- a/include/linux/oom.h
> > +++ b/include/linux/oom.h
> > @@ -77,15 +77,6 @@ static inline bool tsk_is_oom_victim(struct task_struct * tsk)
> > 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);
> > -}
> > -
>
> The patch "mm: multi-gen LRU: support page table walks" from the MGLRU
> series
> (https://lkml.kernel.org/r/20220815071332.627393-9-yuzhao@google.com)
> adds two calls to mm_is_oom_victim(), so my build broke.
>
> I assume the fix is simply
>
> --- a/mm/vmscan.c~mm-delete-unused-mmf_oom_victim-flag-fix
> +++ a/mm/vmscan.c
> @@ -3429,9 +3429,6 @@ static bool should_skip_mm(struct mm_str
> if (size < MIN_LRU_BATCH)
> return true;
>
> - if (mm_is_oom_victim(mm))
> - return true;
> -
> return !mmget_not_zero(mm);
> }
>
> @@ -4127,9 +4124,6 @@ restart:
>
> walk_pmd_range(&val, addr, next, args);
>
> - if (mm_is_oom_victim(args->mm))
> - return 1;
> -
> /* a racy check to curtail the waiting time */
> if (wq_has_sleeper(&walk->lruvec->mm_state.wait))
> return 1;
> _
>
> Please confirm?
LGTM. The deleted checks are not about correctness.
I've queued
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3402,7 +3402,7 @@ static bool should_skip_mm(struct mm_struct *mm,
struct lru_gen_mm_walk *walk)
if (size < MIN_LRU_BATCH)
return true;
- if (mm_is_oom_victim(mm))
+ if (test_bit(MMF_OOM_REAP_QUEUED, &mm->flags))
return true;
return !mmget_not_zero(mm);
@@ -4109,7 +4109,7 @@ static int walk_pud_range(p4d_t *p4d, unsigned
long start, unsigned long end,
walk_pmd_range(&val, addr, next, args);
- if (mm_is_oom_victim(args->mm))
+ if (test_bit(MMF_OOM_REAP_QUEUED, &args->mm->flags))
return 1;
/* a racy check to curtail the waiting time */
Powered by blists - more mailing lists