public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
	loongarch@lists.linux.dev,  Clark Williams <clrkwllms@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	 linux-rt-devel@lists.linux.dev, Xuerui Wang <kernel@xen0n.name>,
	 Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-kernel@vger.kernel.org,  loongson-kernel@lists.loongnix.cn
Subject: Re: [PATCH V2 2/4] LoongArch: Fix sleeping in atomic context for PREEMPT_RT
Date: Wed, 20 Nov 2024 16:35:17 +0800	[thread overview]
Message-ID: <CAAhV-H5euU0Cm=YE=FM2+B0cSKCWsHt+PzUkhAfAgaNeKAEgFg@mail.gmail.com> (raw)
In-Reply-To: <20241120080521.ynDZpGQd@linutronix.de>

On Wed, Nov 20, 2024 at 4:05 PM Sebastian Andrzej Siewior
<bigeasy@linutronix.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

  reply	other threads:[~2024-11-20  8:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-17  5:37 [PATCH V2 0/4] LoongArch: Add PREEMPT_RT support Huacai Chen
2024-11-17  5:40 ` [PATCH V2 1/4] LoongArch: Reduce min_delta for the arch clockevent device Huacai Chen
2024-11-17  5:40   ` [PATCH V2 2/4] LoongArch: Fix sleeping in atomic context for PREEMPT_RT Huacai Chen
2024-11-20  7:40     ` Sebastian Andrzej Siewior
2024-11-20  7:46       ` Huacai Chen
2024-11-20  8:05         ` Sebastian Andrzej Siewior
2024-11-20  8:35           ` Huacai Chen [this message]
2024-11-17  5:40   ` [PATCH V2 3/4] LoongArch: Select HAVE_POSIX_CPU_TIMERS_TASK_WORK Huacai Chen
2024-11-17  5:40   ` [PATCH V2 4/4] LoongArch: Allow to enable PREEMPT_RT Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAhV-H5euU0Cm=YE=FM2+B0cSKCWsHt+PzUkhAfAgaNeKAEgFg@mail.gmail.com' \
    --to=chenhuacai@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=chenhuacai@loongson.cn \
    --cc=clrkwllms@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=loongarch@lists.linux.dev \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox