From: Shung-Hsi Yu <shung-hsi.yu@suse.com> To: Nitesh Lal <nilal@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Robin Murphy <robin.murphy@arm.com>, Marcelo Tosatti <mtosatti@redhat.com>, Ingo Molnar <mingo@kernel.org>, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, jbrandeb@kernel.org, "frederic@kernel.org" <frederic@kernel.org>, "juri.lelli@redhat.com" <juri.lelli@redhat.com>, Alex Belits <abelits@marvell.com>, "linux-api@vger.kernel.org" <linux-api@vger.kernel.org>, "bhelgaas@google.com" <bhelgaas@google.com>, "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>, "rostedt@goodmis.org" <rostedt@goodmis.org>, "peterz@infradead.org" <peterz@infradead.org>, "davem@davemloft.net" <davem@davemloft.net>, "akpm@linux-foundation.org" <akpm@linux-foundation.org>, "sfr@canb.auug.org.au" <sfr@canb.auug.org.au>, "stephen@networkplumber.org" <stephen@networkplumber.org>, "rppt@linux.vnet.ibm.com" <rppt@linux.vnet.ibm.com>, "jinyuqi@huawei.com" <jinyuqi@huawei.com>, "zhangshaokun@hisilicon.com" <zhangshaokun@hisilicon.com>, netdev@vger.kernel.org, chris.friesen@windriver.com, Marc Zyngier <maz@kernel.org>, Neil Horman <nhorman@tuxdriver.com>, pjwaskiewicz@gmail.com Subject: Re: [PATCH] genirq: Provide new interfaces for affinity hints Date: Fri, 28 May 2021 15:20:41 +0800 [thread overview] Message-ID: <YLCZyVXiMfQshpgL@syu-laptop> (raw) In-Reply-To: <CAFki+LnuharcwJy=x4Z27ixCMK1u2s2cvHh9=Bcf90rO06osEw@mail.gmail.com> 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@suse.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 >
WARNING: multiple messages have this Message-ID (diff)
From: Shung-Hsi Yu <shung-hsi.yu@suse.com> To: intel-wired-lan@osuosl.org Subject: [Intel-wired-lan] [PATCH] genirq: Provide new interfaces for affinity hints Date: Fri, 28 May 2021 15:20:41 +0800 [thread overview] Message-ID: <YLCZyVXiMfQshpgL@syu-laptop> (raw) In-Reply-To: <CAFki+LnuharcwJy=x4Z27ixCMK1u2s2cvHh9=Bcf90rO06osEw@mail.gmail.com> 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@suse.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 >
next prev parent reply other threads:[~2021-05-28 7:21 UTC|newest] Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-01 2:18 [PATCH tip:irq/core v1] genirq: remove auto-set of the mask when setting the hint Jesse Brandeburg 2021-05-01 2:18 ` [Intel-wired-lan] " Jesse Brandeburg 2021-05-04 12:15 ` Robin Murphy 2021-05-04 12:15 ` [Intel-wired-lan] " Robin Murphy 2021-05-04 14:29 ` Nitesh Lal 2021-05-04 14:29 ` [Intel-wired-lan] " Nitesh Lal 2021-05-04 16:23 ` Jesse Brandeburg 2021-05-04 16:23 ` [Intel-wired-lan] " Jesse Brandeburg 2021-05-17 16:57 ` Nitesh Lal 2021-05-17 16:57 ` [Intel-wired-lan] " Nitesh Lal 2021-05-17 17:26 ` Robin Murphy 2021-05-17 17:26 ` [Intel-wired-lan] " Robin Murphy 2021-05-17 18:08 ` Thomas Gleixner 2021-05-17 18:08 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-17 18:50 ` Robin Murphy 2021-05-17 18:50 ` [Intel-wired-lan] " Robin Murphy 2021-05-17 19:08 ` Thomas Gleixner 2021-05-17 19:08 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-17 19:43 ` Thomas Gleixner 2021-05-17 19:43 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-17 20:18 ` Thomas Gleixner 2021-05-17 20:18 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-17 18:21 ` Nitesh Lal 2021-05-17 18:21 ` [Intel-wired-lan] " Nitesh Lal 2021-05-17 19:47 ` Thomas Gleixner 2021-05-17 19:47 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-17 21:13 ` Nitesh Lal 2021-05-17 21:13 ` [Intel-wired-lan] " Nitesh Lal 2021-05-17 20:48 ` Thomas Gleixner 2021-05-17 20:48 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-17 22:44 ` Nitesh Lal 2021-05-17 22:44 ` [Intel-wired-lan] " Nitesh Lal 2021-05-18 0:03 ` Thomas Gleixner 2021-05-18 0:03 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-18 0:23 ` Nitesh Lal 2021-05-18 0:23 ` [Intel-wired-lan] " Nitesh Lal 2021-05-20 21:57 ` Nitesh Lal 2021-05-20 21:57 ` [Intel-wired-lan] " Nitesh Lal 2021-05-21 0:03 ` Nitesh Lal 2021-05-21 0:03 ` [Intel-wired-lan] " Nitesh Lal 2021-05-21 11:56 ` Thomas Gleixner 2021-05-21 11:56 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-21 12:03 ` [PATCH] genirq: Provide new interfaces for affinity hints Thomas Gleixner 2021-05-21 12:03 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-21 15:45 ` Lijun Pan 2021-05-21 15:45 ` [Intel-wired-lan] " Lijun Pan 2021-05-21 21:45 ` Thomas Gleixner 2021-05-21 21:45 ` [Intel-wired-lan] " Thomas Gleixner 2021-05-21 16:13 ` Nitesh Lal 2021-05-21 16:13 ` [Intel-wired-lan] " Nitesh Lal 2021-05-21 21:48 ` Thomas Gleixner 2021-05-21 21:48 ` [Intel-wired-lan] " Thomas Gleixner 2021-06-04 20:35 ` Nitesh Lal 2021-06-04 20:35 ` [Intel-wired-lan] " Nitesh Lal 2021-05-27 10:03 ` Shung-Hsi Yu 2021-05-27 10:03 ` [Intel-wired-lan] " Shung-Hsi Yu 2021-05-27 10:21 ` Shung-Hsi Yu 2021-05-27 10:21 ` [Intel-wired-lan] " Shung-Hsi Yu 2021-05-27 13:06 ` Nitesh Lal 2021-05-27 13:06 ` [Intel-wired-lan] " Nitesh Lal 2021-05-28 7:20 ` Shung-Hsi Yu [this message] 2021-05-28 7:20 ` Shung-Hsi Yu 2021-06-07 17:00 ` Nitesh Lal 2021-06-07 17:00 ` [Intel-wired-lan] " Nitesh Lal 2021-06-14 16:12 ` Nitesh Lal 2021-06-14 16:12 ` [Intel-wired-lan] " Nitesh Lal 2021-05-21 13:46 ` [PATCH tip:irq/core v1] genirq: remove auto-set of the mask when setting the hint Nitesh Lal 2021-05-21 13:46 ` [Intel-wired-lan] " Nitesh Lal 2021-05-21 15:15 ` Thomas Gleixner 2021-05-21 15:15 ` [Intel-wired-lan] " Thomas Gleixner 2021-12-10 19:54 ` [tip: irq/core] genirq: Provide new interfaces for affinity hints tip-bot2 for Thomas Gleixner
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=YLCZyVXiMfQshpgL@syu-laptop \ --to=shung-hsi.yu@suse.com \ --cc=abelits@marvell.com \ --cc=akpm@linux-foundation.org \ --cc=bhelgaas@google.com \ --cc=chris.friesen@windriver.com \ --cc=davem@davemloft.net \ --cc=frederic@kernel.org \ --cc=intel-wired-lan@lists.osuosl.org \ --cc=jbrandeb@kernel.org \ --cc=jesse.brandeburg@intel.com \ --cc=jinyuqi@huawei.com \ --cc=juri.lelli@redhat.com \ --cc=linux-api@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pci@vger.kernel.org \ --cc=maz@kernel.org \ --cc=mingo@kernel.org \ --cc=mtosatti@redhat.com \ --cc=netdev@vger.kernel.org \ --cc=nhorman@tuxdriver.com \ --cc=nilal@redhat.com \ --cc=peterz@infradead.org \ --cc=pjwaskiewicz@gmail.com \ --cc=robin.murphy@arm.com \ --cc=rostedt@goodmis.org \ --cc=rppt@linux.vnet.ibm.com \ --cc=sfr@canb.auug.org.au \ --cc=stephen@networkplumber.org \ --cc=tglx@linutronix.de \ --cc=zhangshaokun@hisilicon.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.