Re: [PATCH V2 2/4] LoongArch: Fix sleeping in atomic context for PREEMPT_RT
From: Sebastian Andrzej Siewior
Date: Wed Nov 20 2024 - 03:05:38 EST
On 2024-11-20 15:46:08 [+0800], Huacai Chen wrote:
> > > diff --git a/arch/loongarch/mm/tlb.c b/arch/loongarch/mm/tlb.c
> > > index 5ac9beb5f093..3b427b319db2 100644
> > > --- a/arch/loongarch/mm/tlb.c
> > > +++ b/arch/loongarch/mm/tlb.c
> > > @@ -289,7 +289,7 @@ static void setup_tlb_handler(int cpu)
> > > /* Avoid lockdep warning */
> > > rcutree_report_cpu_starting(cpu);
> > >
> > > -#ifdef CONFIG_NUMA
> > > +#if defined(CONFIG_NUMA) && !defined(CONFIG_PREEMPT_RT)
> > > vec_sz = sizeof(exception_handlers);
> >
> > How does this work with NUMA and RT? You don't allocate memory and
> > everything is fine? Couldn't you pre-allocate the memory on the boot CPU
> > before kicking the CPU to boot? And then just assign the memory here.
> Allocating percpu exception pages on the own node is just an
> optimization, everything can work without this optimization.
> Preallocation is meaningless because all pages come from Node-0.
Don't you have alloc_pages_node() where you can set the node?
And I mean pre-allocation so you don't have to allocate memory here but
already have it ready.
> Huacai
Sebastian