[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQ+13THw9nWZwBu29+BSTDsKD5VJRjc4WvL021zSQFrG=g@mail.gmail.com>
Date: Sat, 7 Feb 2026 11:23:03 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Thomas Gleixner <tglx@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Vlastimil Babka <vbabka@...e.cz>,
Peter Zijlstra <peterz@...radead.org>, Alexei Starovoitov <ast@...nel.org>, linux-mm@...r.kernel.org
Subject: Re: debugobject: Make it work with deferred page initialization - again
On Sat, Feb 7, 2026 at 5:27 AM Thomas Gleixner <tglx@...nel.org> wrote:
>
> debugobjects uses __GFP_HIGH for allocations as it might be invoked
> within locked regions. That worked perfectly fine until v6.18. It still
> works correctly when deferred page initialization is disabled and works
> by chance when no page allocation is required before deferred page
> initialization has completed.
>
> Since v6.18 allocations w/o a reclaim flag cause new_slab() to end up in
> alloc_frozen_pages_nolock_noprof(), which returns early when deferred
> page initialization has not yet completed. As the deferred page
> initialization takes quite a while the debugobject pool is depleted and
> debugobjects are disabled.
>
> This can be worked around when PREEMPT_COUNT is enabled as that allows
> debugobjects to add __GFP_KSWAPD_RECLAIM to the GFP flags when the context
> is preemtible. When PREEMPT_COUNT is disabled the context is unknown and
> the reclaim bit can't be set because the caller might hold locks which
> might deadlock in the allocator.
>
> In preemptible context the reclaim bit is harmless and not a performance
> issue as that's usually invoked from slow path initialization context.
>
> That makes debugobjects depend on PREEMPT_COUNT || !DEFERRED_STRUCT_PAGE_INIT.
>
> Fixes: af92793e52c3 ("slab: Introduce kmalloc_nolock() and kfree_nolock().")
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Tricky. The patch makes sense to me.
Acked-by: Alexei Starovoitov <ast@...nel.org>
Powered by blists - more mailing lists