[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250324113443.215c036f@kernel.org>
Date: Mon, 24 Mar 2025 11:34:43 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Qingfang Deng <dqfext@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, Maxime Coquelin <mcoquelin.stm32@...il.com>, Alexandre
Torgue <alexandre.torgue@...s.st.com>, Ong Boon Leong
<boon.leong.ong@...el.com>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH net v2] net: stmmac: Fix accessing freed irq
affinity_hint
On Tue, 18 Mar 2025 11:24:23 +0800 Qingfang Deng wrote:
> - cpumask_clear(&cpu_mask);
> - cpumask_set_cpu(i % num_online_cpus(), &cpu_mask);
> - irq_set_affinity_hint(priv->rx_irq[i], &cpu_mask);
> + irq_set_affinity_hint(priv->rx_irq[i],
> + cpumask_of(i % num_online_cpus()));
This does fix the bug you're targeting, but FWIW num_online_cpus()
is not great in general. The online CPU mask can be sparse.
You may want to look into finding 'nth' online CPU instead of the naive
modulo as a follow up.
Powered by blists - more mailing lists