[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YLCZyVXiMfQshpgL@syu-laptop>
Date: Fri, 28 May 2021 15:20:41 +0800
From: Shung-Hsi Yu <shung-hsi.yu@...e.com>
To: Nitesh Lal <nilal@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Robin Murphy <robin.murphy@....com>,
Marcelo Tosatti <mtosatti@...hat.com>,
Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
intel-wired-lan@...ts.osuosl.org, jbrandeb@...nel.org,
"frederic@...nel.org" <frederic@...nel.org>,
"juri.lelli@...hat.com" <juri.lelli@...hat.com>,
Alex Belits <abelits@...vell.com>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"sfr@...b.auug.org.au" <sfr@...b.auug.org.au>,
"stephen@...workplumber.org" <stephen@...workplumber.org>,
"rppt@...ux.vnet.ibm.com" <rppt@...ux.vnet.ibm.com>,
"jinyuqi@...wei.com" <jinyuqi@...wei.com>,
"zhangshaokun@...ilicon.com" <zhangshaokun@...ilicon.com>,
netdev@...r.kernel.org, chris.friesen@...driver.com,
Marc Zyngier <maz@...nel.org>,
Neil Horman <nhorman@...driver.com>, pjwaskiewicz@...il.com
Subject: Re: [PATCH] genirq: Provide new interfaces for affinity hints
On Thu, May 27, 2021 at 09:06:04AM -0400, Nitesh Lal wrote:
> On Thu, May 27, 2021 at 6:03 AM Shung-Hsi Yu <shung-hsi.yu@...e.com> wrote:
> >
> > Hi,
> >
> > On Fri, May 21, 2021 at 02:03:06PM +0200, Thomas Gleixner wrote:
> > > The discussion about removing the side effect of irq_set_affinity_hint() of
> > > actually applying the cpumask (if not NULL) as affinity to the interrupt,
> > > unearthed a few unpleasantries:
> > >
> > > 1) The modular perf drivers rely on the current behaviour for the very
> > > wrong reasons.
> > >
> > > 2) While none of the other drivers prevents user space from changing
> > > the affinity, a cursorily inspection shows that there are at least
> > > expectations in some drivers.
> > >
> > > #1 needs to be cleaned up anyway, so that's not a problem
> > >
> > > #2 might result in subtle regressions especially when irqbalanced (which
> > > nowadays ignores the affinity hint) is disabled.
> > >
> > > Provide new interfaces:
> > >
> > > irq_update_affinity_hint() - Only sets the affinity hint pointer
> > > irq_apply_affinity_hint() - Set the pointer and apply the affinity to
> > > the interrupt
> > >
> > > Make irq_set_affinity_hint() a wrapper around irq_apply_affinity_hint() and
> > > document it to be phased out.
> >
> > Is there recommended way to retrieve the CPU number that the interrupt has
> > affinity?
> >
> > Previously a driver (I'm looking at drivers/net/ethernet/amazon/ena) that
> > uses irq_set_affinity_hint() to spread out IRQ knows the corresponding CPU
> > number since they're using their own spreading scheme. Now, phasing out
> > irq_set_affinity_hint(), and thus relying on request_irq() to spread the
> > load instead, there don't seem to be a easy way to get the CPU number.
> >
>
> For drivers that don't want to rely on request_irq for spreading and want
> to force their own affinity mask can use irq_set_affinity()
I *do* want the driver to rely on request_irq() for spreading.
It is retrieving effective affinity after request_irq() call that I can't
seem to figure out.
Thanks,
Shung-Hsi
> which is an exported interface now [1] and clearly indicates the purpose
> of the usage.
>
> As Thomas suggested we are still keeping irq_set_affinity_hint() as a
> wrapper until we make appropriate changes in individual drivers that use
> this API for different reasons. Please feel free to send out a patch
> for this driver once the changes are merged.
>
> [1] https://lkml.org/lkml/2021/5/18/271
>
> --
> Thanks
> Nitesh
>
Powered by blists - more mailing lists