Re: [PATCH] mm/page_alloc: skip shuffling and reporting for no-lock frees
From: Sebastian Andrzej Siewior
Date: Tue Oct 20 2026 - 07:17:10 EST
On 2026-10-20 12:02:01 [+0200], Vlastimil Babka (SUSE) wrote:
> > An instrumented PREEMPT_RT lockdep run forced a random-bit cache refill
> > while calling free_pages_nolock() under a raw spinlock. The unpatched
> > allocator reported:
> >
> > BUG: Invalid wait context
> >
> > The attempted lock was batched_entropy_u64.lock in get_random_u64().
> > Lockdep showed the raw test lock and zone->lock both held.
>
> In slab we solved this by using prandom - commit a1e244a9f177 ("mm/slab: use
> prandom if !allow_spin")
> Could be better?
I hated it at first but now that I looked longer at it, it is not that
bad.
Sebastian