[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c933f5b-983e-a332-e410-6ee6872f839f@google.com>
Date: Mon, 23 Oct 2023 14:10:38 -0700 (PDT)
From: Hugh Dickins <hughd@...gle.com>
To: Zi Yan <ziy@...dia.com>
cc: Hugh Dickins <hughd@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andi Kleen <ak@...ux.intel.com>,
Christoph Lameter <cl@...ux.com>,
Matthew Wilcox <willy@...radead.org>,
Mike Kravetz <mike.kravetz@...cle.com>,
David Hildenbrand <david@...hat.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Yang Shi <shy828301@...il.com>,
Sidhartha Kumar <sidhartha.kumar@...cle.com>,
Vishal Moola <vishal.moola@...il.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Tejun Heo <tj@...nel.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Michal Hocko <mhocko@...e.com>,
"Huang, Ying" <ying.huang@...el.com>,
Nhat Pham <nphamcs@...il.com>,
Yosry Ahmed <yosryahmed@...gle.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v3 10/12] mempolicy: alloc_pages_mpol() for NUMA policy
without vma
On Mon, 23 Oct 2023, Zi Yan wrote:
> On 19 Oct 2023, at 16:39, Hugh Dickins wrote:
> > @@ -1170,6 +1170,15 @@ static struct folio *new_folio(struct folio *src, unsigned long start)
> > break;
> > }
> >
> > + /*
> > + * __get_vma_policy() now expects a genuine non-NULL vma. Return NULL
> > + * when the page can no longer be located in a vma: that is not ideal
> > + * (migrate_pages() will give up early, presuming ENOMEM), but good
> > + * enough to avoid a crash by syzkaller or concurrent holepunch.
> > + */
> > + if (!vma)
> > + return NULL;
> > +
>
> How often would this happen? I just want to point out that ENOMEM can cause
> src THPs or large folios to be split by migrate_pages().
The only case I know of it happening was when a file was mapped, then that
file truncated (cutting out the source page) before migrate_pages(&pagelist)
reached it - rather a syzbotty thing to do, not of great reallife concern.
I won't assert that's the only way: I've a ghost of a memory of another way,
that I can't quite resurface, from a long-ago version of queue_pages_range().
But in the end just didn't care enough about it, because this is really just
to save a bisection point from crashing - the possibility goes away in the
11/12 commit which follows this one, which takes VMA out of it altogether.
Hugh
Powered by blists - more mailing lists