[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZnNEsVtshehiR0A4@casper.infradead.org>
Date: Wed, 19 Jun 2024 21:50:57 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: David Hildenbrand <david@...hat.com>, Gavin Shan <gshan@...hat.com>,
Bagas Sanjaya <bagasdotme@...il.com>,
Zhenyu Zhang <zhenyzha@...hat.com>,
Linux XFS <linux-xfs@...r.kernel.org>,
Linux Filesystems Development <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Shaoqin Huang <shahuang@...hat.com>,
Chandan Babu R <chandan.babu@...cle.com>,
"Darrick J. Wong" <djwong@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: Endless calls to xas_split_alloc() due to corrupted xarray entry
On Wed, Jun 19, 2024 at 08:48:28AM -0700, Linus Torvalds wrote:
> On Wed, 19 Jun 2024 at 07:31, Matthew Wilcox <willy@...radead.org> wrote:
> >
> > Actually, it's 11. We can't split an order-12 folio because we'd have
> > to allocate two levels of radix tree, and I decided that was too much
> > work. Also, I didn't know that ARM used order-13 PMD size at the time.
> >
> > I think this is the best fix (modulo s/12/11/).
>
> Can we use some more descriptive thing than the magic constant 11 that
> is clearly very subtle.
>
> Is it "XA_CHUNK_SHIFT * 2 - 1"
>
> IOW, something like
>
> #define MAX_XAS_ORDER (XA_CHUNK_SHIFT * 2 - 1)
> #define MAX_PAGECACHE_ORDER min(HPAGE_PMD_ORDER,12)
>
> except for the non-TRANSPARENT_HUGEPAGE case where it currently does
>
> #define MAX_PAGECACHE_ORDER 8
>
> and I assume that "8" is just "random round value, smaller than 11"?
It's actually documented:
/*
* There are some parts of the kernel which assume that PMD entries
* are exactly HPAGE_PMD_ORDER. Those should be fixed, but until then,
* limit the maximum allocation order to PMD size. I'm not aware of any
* assumptions about maximum order if THP are disabled, but 8 seems like
* a good order (that's 1MB if you're using 4kB pages)
*/
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
#define MAX_PAGECACHE_ORDER HPAGE_PMD_ORDER
#else
#define MAX_PAGECACHE_ORDER 8
#endif
although I'm not even sure if we use it if CONFIG_TRANSPARENT_HUGEPAGE
is disabled. All the machinery to split pages is gated by
CONFIG_TRANSPARENT_HUGEPAGE, so I think we end up completely ignoring
it. I used to say "somebody should do the work to split out
CONFIG_LARGE_FOLIOS from CONFIG_TRANSPARENT_HUGEPAGE", but now I think
that nobody cares about the architectures that don't support it,
and it's not worth anybody's time pretending that we do.
Powered by blists - more mailing lists