[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H5euU0Cm=YE=FM2+B0cSKCWsHt+PzUkhAfAgaNeKAEgFg@mail.gmail.com>
Date: Wed, 20 Nov 2024 16:35:17 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Huacai Chen <chenhuacai@...ngson.cn>, loongarch@...ts.linux.dev,
Clark Williams <clrkwllms@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
linux-rt-devel@...ts.linux.dev, Xuerui Wang <kernel@...0n.name>,
Jiaxun Yang <jiaxun.yang@...goat.com>, linux-kernel@...r.kernel.org,
loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH V2 2/4] LoongArch: Fix sleeping in atomic context for PREEMPT_RT
On Wed, Nov 20, 2024 at 4:05 PM Sebastian Andrzej Siewior
<bigeasy@...utronix.de> wrote:
>
> 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?
This function is called when a non-boot cpu is online, at this point
NUMA has already been initialized.
> And I mean pre-allocation so you don't have to allocate memory here but
> already have it ready.
If the per-cpu exception handler page is not on its own node,
pre-allocation makes no sense. The performance is the same as
disabling optimization (use global exception handlers).
Huacai
>
> > Huacai
>
> Sebastian
Powered by blists - more mailing lists