Re: [PATCH RESEND v2 2/2] mm: delete unused MMF_OOM_VICTIM flag

From: Andrew Morton
Date: Mon Aug 22 2022 - 18:48:35 EST


On Mon, 22 Aug 2022 16:33:51 -0600 Yu Zhao <yuzhao@xxxxxxxxxx> wrote:

> > --- 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.

OK, for now.

> 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 */

Oh. Why? What does this change do?