Re: [PATCH RFC v2 06/20] slab: make percpu sheaves compatible with kmalloc_nolock()/kfree_nolock()

From: Alexei Starovoitov

Date: Tue Jan 13 2026 - 18:27:05 EST


On Tue, Jan 13, 2026 at 10:36 AM Sebastian Andrzej Siewior
<bigeasy@xxxxxxxxxxxxx> wrote:
>
> On 2026-01-12 16:17:00 [+0100], Vlastimil Babka wrote:
> > --- a/mm/slub.c
> > +++ b/mm/slub.c
> > @@ -5727,6 +5742,12 @@ void *kmalloc_nolock_noprof(size_t size, gfp_t gfp_flags, int node)
> > */
> > return NULL;
> >
> > + ret = alloc_from_pcs(s, alloc_gfp, node);
> > + if (ret)
> > + goto success;
>
> I'm sorry if I am slow but this actually should actually allow
> kmalloc_nolock() allocations on PREEMPT_RT from atomic context. I am
> mentioning this because of the patch which removes the nmi+hardirq
> condtion (https://lore.kernel.org/all/20260113150639.48407-1-swarajgaikwad1925@xxxxxxxxx)

Right. With sheaves kmalloc_nolock() on RT will be more reliable.