From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Evan Green <evan@rivosinc.com>
Cc: Conor Dooley <conor@kernel.org>,
Conor Dooley <conor.dooley@microchip.com>,
Jisheng Zhang <jszhang@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-riscv@lists.infradead.org, tobias.schaffner@siemens.com,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH RT v2 0/3] riscv: add PREEMPT_RT support
Date: Mon, 6 Nov 2023 09:53:33 +0100 [thread overview]
Message-ID: <20231106085333.AkU2s0m-@linutronix.de> (raw)
In-Reply-To: <CALs-Hsun_6SfdWXHPx-D4djhrKTfwCSm4rkMpt68i+djyDb+RQ@mail.gmail.com>
On 2023-11-03 11:22:40 [-0700], Evan Green wrote:
> > I don't know what it does and how often it needs to be done. The
> > question is would it be okay to do once on system boot or does it need
> > to be done each time the CPU goes up? Is it required to be the first
> > thing it does or can it be delayed to slightly later point in time?
>
> It's essentially a characterization we do on each CPU to figure out if
> misaligned word accesses are fast or slow. This info is reported to
> usermode, and potentially has kernel consumers as well (Charlie's ip
> checksumming series wants to flip a static branch based on it).
So you need to do this on each CPU? And there may be differences between
CPU0 and CPU1? On x86 for instance all CPUs within one socket behave the
same. I'm not aware that different CPUs on sockets within a system are
supported.
> In a sense I barely need the buffer, the buffer is just a runway I use
> to do dummy memcpys across. I need to do it once on boot for each CPU,
> and for any additional CPUs that show up via hotplug. It does not need
> to be done across suspend/resume.
>
> The patch in question was an attempt to move this work to be done in
> parallel, since on systems with lots of CPUs, doing it serially in
> smp_callin() was causing boot time regressions.
>
> For boot, I think the plan I outlined should work: allocate all pages
> in the initcall before calling on_each_cpu(). For hotplug, I'll have
> to find a spot to allocate a buffer before the CPU comes up, so it can
> use it in smp_callin().
My question still remains: Is this needed to be done on each CPU in the
system or would one CPU, the boot CPU, be sufficient? The static branch
you mentioned is not per-CPU basis this is per system. If you hook
this check to CPU-hotplug, then this will happen for instance during
suspend/ resume (of if triggered manually) and the CPU "feature" will
likely not change.
As naive as I am, I would assume that doing this on the boot CPU should
be enough.
> -Evan
Sebastian
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2023-11-06 8:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 14:35 [PATCH RT v2 0/3] riscv: add PREEMPT_RT support Jisheng Zhang
2023-10-31 14:35 ` [PATCH RT v2 1/2] riscv: add PREEMPT_AUTO support Jisheng Zhang
2023-10-31 14:35 ` [PATCH RT v2 2/2] riscv: allow to enable RT Jisheng Zhang
2023-10-31 15:32 ` [PATCH RT v2 0/3] riscv: add PREEMPT_RT support Sebastian Andrzej Siewior
2023-10-31 15:49 ` Jisheng Zhang
2023-10-31 16:44 ` Sebastian Andrzej Siewior
2023-11-01 11:41 ` Jisheng Zhang
2023-11-02 12:31 ` Conor Dooley
2023-11-02 15:54 ` Sebastian Andrzej Siewior
2023-11-02 17:03 ` Jisheng Zhang
2023-11-02 21:37 ` Palmer Dabbelt
2023-11-03 8:17 ` Sebastian Andrzej Siewior
2023-11-03 8:14 ` Conor Dooley
2023-11-03 8:24 ` Sebastian Andrzej Siewior
2023-11-03 17:19 ` Evan Green
2023-11-03 17:39 ` Sebastian Andrzej Siewior
2023-11-03 18:22 ` Evan Green
2023-11-06 8:53 ` Sebastian Andrzej Siewior [this message]
2023-11-06 16:25 ` Evan Green
2023-11-06 21:58 ` Palmer Dabbelt
2023-11-10 15:37 ` Sebastian Andrzej Siewior
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=20231106085333.AkU2s0m-@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=evan@rivosinc.com \
--cc=jszhang@kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=tglx@linutronix.de \
--cc=tobias.schaffner@siemens.com \
/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