From: Florian Bezdeka <florian.bezdeka@siemens.com>
To: Yury Norov <ynorov@nvidia.com>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Yury Norov <yury.norov@gmail.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Andrew Morton <akpm@linux-foundation.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@kernel.org>,
Jan Kiszka <jan.kiszka@siemens.com>,
netdev@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH RFC 1/3] cpumask: Honor irq_default_affinity in cpumask_local_spread()
Date: Fri, 21 Aug 2026 18:36:59 +0200 [thread overview]
Message-ID: <83c18ac5b726769c36b79dcd430198076b3da1a2.camel@siemens.com> (raw)
In-Reply-To: <aoX4HuUxL4tNWvpq@yury>
Hi Yury,
On Wed, 2026-08-19 at 14:38 -0400, Yury Norov wrote:
> On Wed, Aug 19, 2026 at 04:30:30PM +0200, Florian Bezdeka wrote:
> > Many drivers call cpumask_local_spread() to spread IRQs to several
> > CPUs, mainly to get best performance and balance CPU load. For
> > realtime (PREEMPT_RT) and other cpu-isolating workloads the old
> > implementation was triggering an IRQ placement problem. IRQs were
> > targeting CPUs that were isolated for those sensitive workloads.
> >
> > Userland will tell the kernel about the desired IRQ configuration
> > for new interrupts by writing a proper cpumask to
> > /proc/irq/default_smp_affinity. This cpu mask has to be honored to
> > avoid IRQ noise on isolated cores.
> >
> > The default for irq_default_affinity is "all CPUs". So all CPUs will
> > be taken into account for spreading when userland did not configure
> > something special.
> > ---
> > lib/cpumask.c | 10 ++++++----
> > 1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/cpumask.c b/lib/cpumask.c
> > index 5adb9874fbd0f5a42ea8cd9e6c3729a70599781f..73e7b60a9201174f83df6067effbe7d1889dcdb9 100644
> > --- a/lib/cpumask.c
> > +++ b/lib/cpumask.c
> > @@ -6,6 +6,7 @@
> > #include <linux/export.h>
> > #include <linux/memblock.h>
> > #include <linux/numa.h>
> > +#include <linux/interrupt.h>
> >
> > /* These are not inline because of header tangles. */
> > #ifdef CONFIG_CPUMASK_OFFSTACK
> > @@ -81,8 +82,9 @@ void __init free_bootmem_cpumask_var(cpumask_var_t mask)
> > * @i: index number
> > * @node: local numa_node
> > *
> > - * Return: online CPU according to a numa aware policy; local cpus are returned
> > - * first, followed by non-local ones, then it wraps around.
> > + * Return: online CPU according to the default IRQ affinity and a numa aware
> > + * policy; local cpus are returned first, followed by non-local ones, then it
> > + * wraps around.
> > *
> > * For those who wants to enumerate all CPUs based on their NUMA distances,
> > * i.e. call this function in a loop, like:
> > @@ -110,9 +112,9 @@ unsigned int cpumask_local_spread(unsigned int i, int node)
>
> Please don't touch this function. There's ~40 users, and we don't want
> to inspect every caller for their intention.
Yes and no.
Yes: Your suggestions / concerns are valid. Noted.
No: I'm expecting a revisit of all those usages. All "affected" drivers
need to be fixed / addressed at the end, so we have to check all of them
and migrate them.
Sebastian also commented on this meanwhile. I'm fine with migrating
affected drivers one by one. Makes sense.
But before we start the migration process I'm still missing the "plan"
or "vision". Which way do we want to go? Let's see if there is more
input coming.
Should drivers really deal with those cpumasks? I don't think so - at
the moment.
Thanks, highly appreciated.
Florian
next prev parent reply other threads:[~2026-08-21 16:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 14:30 [PATCH RFC 0/3] genirq: Allow drivers to respect userspace IRQ affinities Florian Bezdeka
2026-08-19 14:30 ` [PATCH RFC 1/3] cpumask: Honor irq_default_affinity in cpumask_local_spread() Florian Bezdeka
2026-08-19 18:38 ` Yury Norov
2026-08-20 16:09 ` Sebastian Andrzej Siewior
2026-08-21 17:14 ` Florian Bezdeka
2026-08-21 16:36 ` Florian Bezdeka [this message]
2026-08-19 14:30 ` [PATCH RFC 2/3] genirq: Honor existing IRQ affinities when setting affinity hints Florian Bezdeka
2026-08-20 16:41 ` Jakub Kicinski
2026-08-21 10:38 ` Jan Kiszka
2026-08-21 10:53 ` Sebastian Andrzej Siewior
2026-08-21 17:30 ` Florian Bezdeka
2026-08-19 14:30 ` [PATCH RFC 3/3] net: stmmac: Migrate IRQ balancing to cpumask_local_spread() Florian Bezdeka
2026-08-19 18:45 ` Yury Norov
2026-08-21 16:40 ` Florian Bezdeka
2026-08-19 18:28 ` [PATCH RFC 0/3] genirq: Allow drivers to respect userspace IRQ affinities Yury Norov
2026-08-19 23:54 ` Andrew Lunn
2026-08-20 0:10 ` Andrew Lunn
2026-08-21 16:57 ` Florian Bezdeka
2026-08-21 16:47 ` Florian Bezdeka
2026-08-20 15:12 ` Sebastian Andrzej Siewior
2026-08-21 17:09 ` Florian Bezdeka
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=83c18ac5b726769c36b79dcd430198076b3da1a2.camel@siemens.com \
--to=florian.bezdeka@siemens.com \
--cc=akpm@linux-foundation.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jan.kiszka@siemens.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@rasmusvillemoes.dk \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@kernel.org \
--cc=ynorov@nvidia.com \
--cc=yury.norov@gmail.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