Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565298

Re: [PATCH] PCI/MSI: Export all remapped MSIs to sysfs attributes

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Myron Stowe <myron.stowe@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] PCI/MSI: Export all remapped MSIs to sysfs attributes
Date Mon, 23 Jan 2017 22:00:02 +0100
Message-ID <t2TSy-2N8-9@gated-at.bofh.it> (permalink)
References <qhOut-7eA-13@gated-at.bofh.it> <t2TSy-2N8-11@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/QHG2FX0zkTMhstNtW6aRY7/7eAG3V/sSkFy0DuZI1U=; b=YOrbLONodcRXpinAycjIOL/ch/v+WIMA+bJL1ekLfU2gINWsEAbOmgaINvTv9tEnGr 2DXQKvbk5GpumJQyRNSph4vxTyT3S3gx8N1XuqZXmVAJ74LWq4Jkryu7LZJQXx3vKGiT Ux2vU4wmY2tYbPgf+m+1Ft1ljCEY+nlFDiNTvmh87uWPAMipFUIZQjv6nDPL4P0RGD8h 671l1SixGIDW3637uMAPuEFdH9Qg7yQLpsz3tMYN3YNAdkP6sy5s+7Hw10GgsS7Qkmfb T0/nEsyS9nIV4G1KEV4ytUlFthsTB1JzHdp/hIprjhvA9Po93df+sDQjIFoqlrxEGiUS xgOQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/QHG2FX0zkTMhstNtW6aRY7/7eAG3V/sSkFy0DuZI1U=; b=S/GNtDni3bukIzsrmcsqxq9Avf4VW2ZHBpFO9M4Dq4pZ1xlf56TYF1bKFPXklqrByd wwzsAJ0F3psAkxtPf8j/8K2J5eNVwBjnGNDCNsEVO5MylCgL3pWvyngP5w0mKHngJNyu dwb9ncUiEn8cQ4NGKmB8vkd1/1nXI5yc0YXoHKNHqJQdlNiDiwM6EJEvh0wqDgh99Vix S5o4vyHogHaQ+Z9klC1k3Um1gUEwEbNolUwW9U7g1wy4DWz0nYgH2/ps6WkZbMEsbxEV /Zqw05u0H0tQ9uCTMfP86sndMYZlq1JDIav/AJn4w+lEgORCujSkSQuRBOb19YzY6EmL yw+w==
X-Gm-Message-State AIkVDXLZMJu7MFvvaXcHxy9a45YxmJMCVk5UZTD5w5GYJZrbpQoZZ+ivBeRc22AdADnEk3GW9vGtbrj9AY0BJg==
X-Received by 10.200.52.209 with SMTP id x17mr27639183qtb.74.1485205049341; Mon, 23 Jan 2017 12:57:29 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 93
Organization linux.* mail to news gateway
X-Original-Cc linux-pci <linux-pci@vger.kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, LKML <linux-kernel@vger.kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Neil Horman <nhorman@tuxdriver.com>
X-Original-Date Mon, 23 Jan 2017 13:57:28 -0700
X-Original-Message-ID <CAL-B5D2zfKg2pzc0M2udS3=tNQ-=RzG8qLdBWAQC3KVh4PRQ0g@mail.gmail.com>
X-Original-References <1443051076-27716-1-git-send-email-rbezut@gmail.com> <20151015172305.GC17702@localhost>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1565298

Show key headers only | View raw


On Thu, Oct 15, 2015 at 11:23 AM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Thu, Sep 24, 2015 at 01:31:16AM +0200, Romain Bezut wrote:
>> irqbalance uses these attributes to populate its internal database, which is
>> then used to bind the irq on the appropriate NUMA node.
>>
>> On a device accepting multiple MSIs and with interrupt remapping enabled,
>> only the first irq entry is exported to msi_irqs directory.
>> This results in irqbalance having no clue of the NUMA affinity for the extra
>> irqs and starting to bind them on random nodes.
>>
>> This patch exports all MSI interrupts as sysfs attributes when relevant.
>>
>> Signed-off-by: Romain Bezut <rbezut@gmail.com>
>
> Applied with Thomas' ack to pci/msi for v4.4, thanks, Romain!

Internal testing with netperf - network performance between two
machines with 10Gb Intel NICs running 24 instances of the netperf tool
in parallel (to utilize all CPU cores) - shows a roughly 20%
performance degradation.  Bi-section showed the offending commit to be
this patch: commit a86760664f4 ("PCI/MSI: Export all remapped MSIs to
sysfs attributes").

  Prior: 9.62 +-0.00 gbits/sec
  After: 7.77 +-0.17 gbits/sec

>> ---
>>  drivers/pci/msi.c | 31 +++++++++++++++++--------------
>>  1 file changed, 17 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
>> index d449714..324a164 100644
>> --- a/drivers/pci/msi.c
>> +++ b/drivers/pci/msi.c
>> @@ -475,10 +475,11 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
>>       int ret = -ENOMEM;
>>       int num_msi = 0;
>>       int count = 0;
>> +     int i;
>>
>>       /* Determine how many msi entries we have */
>>       for_each_pci_msi_entry(entry, pdev)
>> -             ++num_msi;
>> +             num_msi += entry->nvec_used;
>>       if (!num_msi)
>>               return 0;
>>
>> @@ -487,19 +488,21 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
>>       if (!msi_attrs)
>>               return -ENOMEM;
>>       for_each_pci_msi_entry(entry, pdev) {
>> -             msi_dev_attr = kzalloc(sizeof(*msi_dev_attr), GFP_KERNEL);
>> -             if (!msi_dev_attr)
>> -                     goto error_attrs;
>> -             msi_attrs[count] = &msi_dev_attr->attr;
>> -
>> -             sysfs_attr_init(&msi_dev_attr->attr);
>> -             msi_dev_attr->attr.name = kasprintf(GFP_KERNEL, "%d",
>> -                                                 entry->irq);
>> -             if (!msi_dev_attr->attr.name)
>> -                     goto error_attrs;
>> -             msi_dev_attr->attr.mode = S_IRUGO;
>> -             msi_dev_attr->show = msi_mode_show;
>> -             ++count;
>> +             for (i = 0; i < entry->nvec_used; i++) {
>> +                     msi_dev_attr = kzalloc(sizeof(*msi_dev_attr), GFP_KERNEL);
>> +                     if (!msi_dev_attr)
>> +                             goto error_attrs;
>> +                     msi_attrs[count] = &msi_dev_attr->attr;
>> +
>> +                     sysfs_attr_init(&msi_dev_attr->attr);
>> +                     msi_dev_attr->attr.name = kasprintf(GFP_KERNEL, "%d",
>> +                                                         entry->irq + i);
>> +                     if (!msi_dev_attr->attr.name)
>> +                             goto error_attrs;
>> +                     msi_dev_attr->attr.mode = S_IRUGO;
>> +                     msi_dev_attr->show = msi_mode_show;
>> +                     ++count;
>> +             }
>>       }
>>
>>       msi_irq_group = kzalloc(sizeof(*msi_irq_group), GFP_KERNEL);
>> --
>> 2.4.9
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] PCI/MSI: Export all remapped MSIs to sysfs attributes Myron Stowe <myron.stowe@gmail.com> - 2017-01-23 22:00 +0100
  Re: [PATCH] PCI/MSI: Export all remapped MSIs to sysfs attributes Neil Horman <nhorman@tuxdriver.com> - 2017-01-23 23:00 +0100

csiph-web