Re: [PATCH] sparc64: fix hugetlb for sun4u

From: John Paul Adrian Glaubitz
Date: Mon Aug 11 2025 - 04:28:46 EST


Hi David,

thanks a lot for your input!

On Mon, 2025-08-11 at 10:20 +0200, David Hildenbrand wrote:
> On 09.08.25 08:23, John Paul Adrian Glaubitz wrote:
> > Hi Anthony,
> >
> > On Sat, 2025-08-09 at 00:37 +0200, John Paul Adrian Glaubitz wrote:
> > > > Maybe try enabling CONFIG_DEBUG_VM_IRQSOFF, CONFIG_DEBUG_VM, and perhaps
> > > > CONFIG_DEBUG_VM_PGFLAGS. That might help detect a problem closer to the
> > > > source. You can also try adding transparent_hugepage=never to the kernel
> > > > boot line to see if compiling in THP support but not using it is okay.
> > >
> > > OK, I will try that. But not today anymore. It's half past midnight now here in Germany
> > > and I was debugging this issue almost all day long. I'm glad to have finally been able
> > > to track this down to THP support being enabled.
> > >
> > > Maybe you can try whether you can reproduce this in QEMU as well.
> >
> > OK, first data point: Setting CONFIG_TRANSPARENT_HUGEPAGE_NEVER=y causes the backtrace during
> > boot to disappear with CONFIG_TRANSPARENT_HUGEPAGE=y. However, it still disappears later when
> > running "apt update && apt -y upgrade" again:
>
> Just to give some context: (m)THPs in file systems will get used
> independently of CONFIG_TRANSPARENT_HUGEPAGE_NEVER=y.
>
> So CONFIG_TRANSPARENT_HUGEPAGE_NEVER=y primarily only controls usage of
> (m)THPs for anonymous memory, but not in the pagecache.

Thanks, this actually explains why CONFIG_TRANSPARENT_HUGEPAGE_NEVER=y doesn't fully mitigate
the problem.

> > [ 170.472743] kernel BUG at fs/ext4/inode.c:1174!
> > [ 170.532313] \|/ ____ \|/
> > "@'/ .. \`@"
> > /_| \__/ |_\
> > \__U_/
>
> Is this the
>
> BUG_ON(to > folio_size(folio));

Yes, I just looked it up in my current local kernel tree and that's indeed the line.

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913