linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: "Alex G." <mr.nuke.me@gmail.com>,
	Bjorn Helgaas <helgaas@kernel.org>,
	Alexandru Gagniuc <alex_gagniuc@dellteam.com>,
	Keith Busch <keith.busch@intel.com>, Jens Axboe <axboe@fb.com>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Cc: Jan Vesely <jano.vesely@gmail.com>,
	Lukas Wunner <lukas@wunner.de>,
	Alex Williamson <alex.williamson@redhat.com>,
	Austin Bolen <austin_bolen@dell.com>,
	Shyam Iyer <Shyam_Iyer@dell.com>, Sinan Kaya <okaya@kernel.org>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Issues with "PCI/LINK: Report degraded links via link bandwidth notification"
Date: Tue, 21 Jan 2020 12:10:08 +0100	[thread overview]
Message-ID: <8409fd7ad6b83da75c914a71accf522953a460a0.camel@pengutronix.de> (raw)
In-Reply-To: <b9764896-102c-84cb-32ea-c2a122b6f0db@gmail.com>

On Mo, 2020-01-20 at 10:01 -0600, Alex G. wrote:
> 
> On 1/19/20 8:33 PM, Bjorn Helgaas wrote:
> > [+cc NVMe, GPU driver folks]
> > 
> > On Wed, Jan 15, 2020 at 04:10:08PM -0600, Bjorn Helgaas wrote:
> > > I think we have a problem with link bandwidth change notifications
> > > (see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/pcie/bw_notification.c).
> > > 
> > > Here's a recent bug report where Jan reported "_tons_" of these
> > > notifications on an nvme device:
> > > https://bugzilla.kernel.org/show_bug.cgi?id=206197
> > > 
> > > There was similar discussion involving GPU drivers at
> > > https://lore.kernel.org/r/20190429185611.121751-2-helgaas@kernel.org
> > > 
> > > The current solution is the CONFIG_PCIE_BW config option, which
> > > disables the messages completely.  That option defaults to "off" (no
> > > messages), but even so, I think it's a little problematic.
> > > 
> > > Users are not really in a position to figure out whether it's safe to
> > > enable.  All they can do is experiment and see whether it works with
> > > their current mix of devices and drivers.
> > > 
> > > I don't think it's currently useful for distros because it's a
> > > compile-time switch, and distros cannot predict what system configs
> > > will be used, so I don't think they can enable it.
> > > 
> > > Does anybody have proposals for making it smarter about distinguishing
> > > real problems from intentional power management, or maybe interfaces
> > > drivers could use to tell us when we should ignore bandwidth changes?
> > 
> > NVMe, GPU folks, do your drivers or devices change PCIe link
> > speed/width for power saving or other reasons?  When CONFIG_PCIE_BW=y,
> > the PCI core interprets changes like that as problems that need to be
> > reported.
> > 
> > If drivers do change link speed/width, can you point me to where
> > that's done?  Would it be feasible to add some sort of PCI core
> > interface so the driver could say "ignore" or "pay attention to"
> > subsequent link changes?
> > 
> > Or maybe there would even be a way to move the link change itself into
> > the PCI core, so the core would be aware of what's going on?
> 
> Funny thing is, I was going to suggest an in-kernel API for this.
>    * Driver requests lower link speed 'X'
>    * Link management interrupt fires
>    * If link speed is at or above 'X' then do not report it.
> I think an "ignore" flag would defeat the purpose of having link 
> bandwidth reporting in the first place. If some drivers set it, and 
> others don't, then it would be inconsistent enough to not be useful.
> 
> A second suggestion is, if there is a way to ratelimit these messages on 
> a per-downstream port basis.

Both AMD and Nvidia GPUs have embedded controllers, which are
responsible for the power management. IIRC those controllers can
autonomously initiate PCIe link speed changes depending on measured bus
load. So there is no way for the driver to signal the requested bus
speed to the PCIe core.

I guess for the GPU usecase the best we can do is to have the driver
opt-out of the link bandwidth notifications, as the driver knows that
there is some autonomous entity on the endpoint mucking with the link
parameters.

Regards,
Lucas


  reply	other threads:[~2020-01-21 11:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 22:10 Issues with "PCI/LINK: Report degraded links via link bandwidth notification" Bjorn Helgaas
2020-01-16  2:44 ` Alex G
2020-01-18  0:18   ` Bjorn Helgaas
2020-01-20  2:33 ` Bjorn Helgaas
2020-01-20 15:56   ` Alex Williamson
2020-01-20 16:01   ` Alex G.
2020-01-21 11:10     ` Lucas Stach [this message]
2020-01-21 14:55       ` Alex G.
2020-02-03  1:56       ` Dave Airlie
2020-02-03  2:04         ` Dave Airlie
2020-02-03  2:07           ` Ben Skeggs
2020-02-03 21:16           ` Alex Deucher
2020-02-04  4:38             ` Lukas Wunner
2020-02-04 14:47               ` Alex Deucher
2020-01-30 16:26   ` Christoph Hellwig
2020-02-22 16:58 ` Bjorn Helgaas
2021-01-28 23:39   ` Bjorn Helgaas
2021-01-28 23:51     ` Sinan Kaya
2021-01-29  0:07       ` Alex G.
2021-01-29 21:56         ` Bjorn Helgaas
2021-02-02 19:50           ` Alex G.
2021-02-02 20:16             ` Bjorn Helgaas
2021-02-02 20:25               ` Alex G.
2021-01-29  1:30     ` Alex Deucher

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=8409fd7ad6b83da75c914a71accf522953a460a0.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=Shyam_Iyer@dell.com \
    --cc=airlied@linux.ie \
    --cc=alex.williamson@redhat.com \
    --cc=alex_gagniuc@dellteam.com \
    --cc=austin_bolen@dell.com \
    --cc=axboe@fb.com \
    --cc=daniel@ffwll.ch \
    --cc=hch@lst.de \
    --cc=helgaas@kernel.org \
    --cc=jano.vesely@gmail.com \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mr.nuke.me@gmail.com \
    --cc=okaya@kernel.org \
    --cc=sagi@grimberg.me \
    /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;
as well as URLs for NNTP newsgroup(s).