public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shay Drori <shayd@nvidia.com>
To: <tglx@linutronix.de>
Cc: <linux-kernel@vger.kernel.org>
Subject: pci_msix_alloc_irq_at() affinity
Date: Thu, 25 Jul 2024 08:34:48 +0300	[thread overview]
Message-ID: <ccb1b2ca-0d62-4c74-ada3-89cce13b8de3@nvidia.com> (raw)

Hello Thomas

I did some testing with pci_msix_alloc_irq_at() and I noticed that the
affinity provided, via “struct irq_affinity_desc *af_desc”, doesn’t have
any affect.

After some digging, I found out that irq_setup_affinity(), which is
called by request_irq(), is setting the affinity as all the CPUs online,
ignoring the affinity provided in pci_msix_alloc_irq_at().
Is this on purpose or a bug?

P.S. The bellow diff honors the affinity provided in
pci_msix_alloc_irq_at()

--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -530,6 +530,7 @@ static int alloc_descs(unsigned int start, unsigned 
int cnt, int node,
                                 flags = IRQD_AFFINITY_MANAGED |
                                         IRQD_MANAGED_SHUTDOWN;
                         }
+                 flags |= IRQD_AFFINITY_SET;
                         mask = &affinity->mask;
                         node = cpu_to_node(cpumask_first(mask));
                         affinity++;

thanks
Shay Drori

             reply	other threads:[~2024-07-25  5:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25  5:34 Shay Drori [this message]
2024-07-26 13:48 ` pci_msix_alloc_irq_at() affinity Thomas Gleixner
2024-08-05  5:34   ` Shay Drori
2024-08-05  8:38     ` 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=ccb1b2ca-0d62-4c74-ada3-89cce13b8de3@nvidia.com \
    --to=shayd@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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