linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-block@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
	linux-pci@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <maz@kernel.org>,
	linuxppc-dev@lists.ozlabs.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Greg Kurz <groug@kaod.org>, Christoph Hellwig <hch@lst.de>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH v2 0/2] powerpc/pseries: fix MSI/X IRQ affinity on pseries
Date: Wed, 25 Nov 2020 12:16:55 +0100	[thread overview]
Message-ID: <20201125111657.1141295-1-lvivier@redhat.com> (raw)

With virtio, in multiqueue case, each queue IRQ is normally\r
bound to a different CPU using the affinity mask.\r
\r
This works fine on x86_64 but totally ignored on pseries.\r
\r
This is not obvious at first look because irqbalance is doing\r
some balancing to improve that.\r
\r
It appears that the "managed" flag set in the MSI entry\r
is never copied to the system IRQ entry.\r
\r
This series passes the affinity mask from rtas_setup_msi_irqs()\r
to irq_domain_alloc_descs() by adding an affinity parameter to\r
irq_create_mapping().\r
\r
The first patch adds the parameter (no functional change), the\r
second patch passes the actual affinity mask to irq_create_mapping()\r
in rtas_setup_msi_irqs().\r
\r
For instance, with 32 CPUs VM and 32 queues virtio-scsi interface:\r
\r
... -smp 32 -device virtio-scsi-pci,id=virtio_scsi_pci0,num_queues=32\r
\r
for IRQ in $(grep virtio2-request /proc/interrupts |cut -d: -f1); do\r
    for file in /proc/irq/$IRQ/ ; do\r
        echo -n "IRQ: $(basename $file) CPU: " ; cat $file/smp_affinity_list\r
    done\r
done\r
\r
Without the patch (and without irqbalanced)\r
\r
IRQ: 268 CPU: 0-31\r
IRQ: 269 CPU: 0-31\r
IRQ: 270 CPU: 0-31\r
IRQ: 271 CPU: 0-31\r
IRQ: 272 CPU: 0-31\r
IRQ: 273 CPU: 0-31\r
IRQ: 274 CPU: 0-31\r
IRQ: 275 CPU: 0-31\r
IRQ: 276 CPU: 0-31\r
IRQ: 277 CPU: 0-31\r
IRQ: 278 CPU: 0-31\r
IRQ: 279 CPU: 0-31\r
IRQ: 280 CPU: 0-31\r
IRQ: 281 CPU: 0-31\r
IRQ: 282 CPU: 0-31\r
IRQ: 283 CPU: 0-31\r
IRQ: 284 CPU: 0-31\r
IRQ: 285 CPU: 0-31\r
IRQ: 286 CPU: 0-31\r
IRQ: 287 CPU: 0-31\r
IRQ: 288 CPU: 0-31\r
IRQ: 289 CPU: 0-31\r
IRQ: 290 CPU: 0-31\r
IRQ: 291 CPU: 0-31\r
IRQ: 292 CPU: 0-31\r
IRQ: 293 CPU: 0-31\r
IRQ: 294 CPU: 0-31\r
IRQ: 295 CPU: 0-31\r
IRQ: 296 CPU: 0-31\r
IRQ: 297 CPU: 0-31\r
IRQ: 298 CPU: 0-31\r
IRQ: 299 CPU: 0-31\r
\r
With the patch:\r
\r
IRQ: 265 CPU: 0\r
IRQ: 266 CPU: 1\r
IRQ: 267 CPU: 2\r
IRQ: 268 CPU: 3\r
IRQ: 269 CPU: 4\r
IRQ: 270 CPU: 5\r
IRQ: 271 CPU: 6\r
IRQ: 272 CPU: 7\r
IRQ: 273 CPU: 8\r
IRQ: 274 CPU: 9\r
IRQ: 275 CPU: 10\r
IRQ: 276 CPU: 11\r
IRQ: 277 CPU: 12\r
IRQ: 278 CPU: 13\r
IRQ: 279 CPU: 14\r
IRQ: 280 CPU: 15\r
IRQ: 281 CPU: 16\r
IRQ: 282 CPU: 17\r
IRQ: 283 CPU: 18\r
IRQ: 284 CPU: 19\r
IRQ: 285 CPU: 20\r
IRQ: 286 CPU: 21\r
IRQ: 287 CPU: 22\r
IRQ: 288 CPU: 23\r
IRQ: 289 CPU: 24\r
IRQ: 290 CPU: 25\r
IRQ: 291 CPU: 26\r
IRQ: 292 CPU: 27\r
IRQ: 293 CPU: 28\r
IRQ: 294 CPU: 29\r
IRQ: 295 CPU: 30\r
IRQ: 299 CPU: 31\r
\r
This matches what we have on an x86_64 system.\r
\r
v2: add a wrapper around original irq_create_mapping() with the\r
    affinity parameter. Update comments\r
\r
Laurent Vivier (2):\r
  genirq: add an irq_create_mapping_affinity() function\r
  powerpc/pseries: pass MSI affinity to irq_create_mapping()\r
\r
 arch/powerpc/platforms/pseries/msi.c |  3 ++-\r
 include/linux/irqdomain.h            | 12 ++++++++++--\r
 kernel/irq/irqdomain.c               | 13 ++++++++-----\r
 3 files changed, 20 insertions(+), 8 deletions(-)\r
\r
-- \r
2.28.0\r
\r


             reply	other threads:[~2020-11-25 11:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 11:16 Laurent Vivier [this message]
2020-11-25 11:16 ` [PATCH v2 1/2] genirq: add an irq_create_mapping_affinity() function Laurent Vivier
2020-11-25 12:45   ` Greg Kurz
2020-11-25 13:20   ` Thomas Gleixner
2020-11-25 14:09     ` Laurent Vivier
2020-11-25 14:54       ` Marc Zyngier
2020-11-25 15:00         ` Laurent Vivier
2020-11-25 11:16 ` [PATCH v2 2/2] powerpc/pseries: pass MSI affinity to irq_create_mapping() Laurent Vivier
2020-11-25 12:51   ` Greg Kurz

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=20201125111657.1141295-1-lvivier@redhat.com \
    --to=lvivier@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=groug@kaod.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maz@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=mst@redhat.com \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCH v2 0/2] powerpc/pseries: fix MSI/X IRQ affinity on pseries' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).