[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZnnA4BswPcyedF2B@casper.infradead.org>
Date: Mon, 24 Jun 2024 19:54:24 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Usama Arif <usamaarif642@...il.com>
Cc: Yosry Ahmed <yosryahmed@...gle.com>,
kernel test robot <oliver.sang@...el.com>, oe-lkp@...ts.linux.dev,
lkp@...el.com, Linux Memory Management List <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Chengming Zhou <chengming.zhou@...ux.dev>,
Nhat Pham <nphamcs@...il.com>, David Hildenbrand <david@...hat.com>,
"Huang, Ying" <ying.huang@...el.com>,
Hugh Dickins <hughd@...gle.com>,
Johannes Weiner <hannes@...xchg.org>,
Shakeel Butt <shakeel.butt@...ux.dev>,
Andi Kleen <ak@...ux.intel.com>, linux-kernel@...r.kernel.org
Subject: Re: [linux-next:master] [mm] 0fa2857d23:
WARNING:at_mm/page_alloc.c:#__alloc_pages_noprof
On Mon, Jun 24, 2024 at 09:50:21PM +0300, Usama Arif wrote:
> On 24/06/2024 21:33, Matthew Wilcox wrote:
> > On Mon, Jun 24, 2024 at 05:05:56AM -0700, Yosry Ahmed wrote:
> > > On Mon, Jun 24, 2024 at 1:49 AM kernel test robot <oliver.sang@...el.com> wrote:
> > > > kernel test robot noticed "WARNING:at_mm/page_alloc.c:#__alloc_pages_noprof" on:
> > > >
> > > > commit: 0fa2857d23aa170e5e28d13c467b303b0065aad8 ("mm: store zero pages to be swapped out in a bitmap")
> > > > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
> > > This is coming from WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp), and
> > > is triggered by the new bitmap_zalloc() call in the swapon path. For a
> > > sufficiently large swapfile, bitmap_zalloc() (which uses kmalloc()
> > > under the hood) cannot be used to allocate the bitmap.
> > Do we need to use a bitmap?
> >
> > We could place a special entry in the swapcache instead (there's
> > XA_ZERO_ENTRY already defined, and if we need a different entry that's
> > not XA_ZERO_ENTRY, there's room for a few hundred more special entries).
>
> I was going for the most space-efficient and simplest data structure, which
> is bitmap. I believe xarray is either pointer or integer between 0 and
> LONG_MAX? We could convert the individual bits into integer and store them,
> and have another function to extract the integer stored in xarray to a bit,
> but I think thats basically a separate bitmap_xarray API (which would
> probably take more space than a traditional bitmap API, and I dont want to
> make this series dependent on something like that), so I would prefer to use
> bitmap.
But we already _have_ an xarray. Instead of storing a swap entry in
it, we could store an XA_ZERO_ENTRY.
If there are long runs of zero pages, then this may not be the best
idea. But then a bitmap isn't the best data structure for long runs
either.
Powered by blists - more mailing lists