From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Alexander Motin <mav@ixsystems.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Lukas Wunner <lukas@wunner.de>,
Chris Chiu <chris.chiu@canonical.com>,
Nicholas Johnson <nicholas.johnson-opensource@outlook.com.au>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH v4 1/2] PCI: Take other bus devices into account when distributing resources
Date: Tue, 10 Jan 2023 12:07:22 +0200 [thread overview]
Message-ID: <Y7042gQsfPmD+21D@black.fi.intel.com> (raw)
In-Reply-To: <2f33bc51-7473-58fc-0b87-fad3984375d6@ixsystems.com>
Hi,
On Mon, Jan 09, 2023 at 01:27:07PM -0500, Alexander Motin wrote:
> On 09.01.2023 06:11, Mika Westerberg wrote:
> > On Thu, Jan 05, 2023 at 11:04:13AM -0600, Bjorn Helgaas wrote:
> > > On Thu, Jan 05, 2023 at 03:43:29PM +0200, Mika Westerberg wrote:
> > > > On Thu, Jan 05, 2023 at 11:12:11AM +0200, Mika Westerberg wrote:
> > > > > > What happens in a topology like this:
> > > > > >
> > > > > > 10:00.0 non-hotplug bridge to [bus 20-3f]
> > > > > > 10:01.0 non-hotplug bridge to [bus 40]
> > > > > > 20:00.0 hotplug bridge
> > > > > > 40:00.0 NIC
> > > > > >
> > > > > > where we're distributing space on "bus" 10, hotplug_bridges == 0 and
> > > > > > normal_bridges == 2? Do we give half the extra space to bus 20 and
> > > > > > the other half to bus 40, even though we could tell up front that bus
> > > > > > 20 is the only place that can actually use any extra space?
> > > > >
> > > > > Yes we split it into half.
> > > >
> > > > Forgot to reply also that would it make sense here to look at below the
> > > > non-hotplug bridges and if we find hotplug bridges, distribute the space
> > > > equally between those or something like that?
> > >
> > > Yes, I do think ultimately it would make sense to keep track at every
> > > bridge whether it or any descendant is a hotplug bridge so we could
> > > distribute extra space only to bridges that could potentially use it.
> > >
> > > But I don't know if that needs to be done in this series. This code
> > > is so complicated and fragile that I think being ruthless about
> > > defining the minimal problem we're solving and avoiding scope creep
> > > will improve our chances of success.
> > >
> > > So treat this as a question to improve my understanding more than
> > > anything.
> >
> > Okay, undestood ;-)
>
> I was also wondering about this problem. But my first though was: if we are
> not going to look down through all the tree, may be we should better
> distribute resources between all bridges no this bus, no matter whether they
> are hot-plug or not? Because behind any non-hotplug bridge may appear a
> hot-plug one. As a possible trivial approach, give hot-plug bridges twice
> of what is given to non-hot-plug ones. ;)
Yeah, this may end up running out of resources pretty quickly. This is
primarily used with Thunderbolt/USB4 devices and the recent ones have up
to 3 downstream PCIe hotplug ports (along with the non-hotplug ones) so
chaining a couple of those quickly consumes all that space.
I'm all ears if there is a good (and simple) strategy for dealing with
this but at least we should not make the functionality worse than what
the current situation is IMHO. I'm going to try the suggestion to look
behind non-hotplug bridges for hotplug ones and see how complex that
becomes ;-)
> PS: Thank you, Mika, for working on this.
No problem :)
next prev parent reply other threads:[~2023-01-10 10:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 9:16 [PATCH v4 0/2] PCI: distribute resources for root buses Mika Westerberg
2023-01-04 9:16 ` [PATCH v4 1/2] PCI: Take other bus devices into account when distributing resources Mika Westerberg
2023-01-04 22:48 ` Bjorn Helgaas
2023-01-05 9:12 ` Mika Westerberg
2023-01-05 13:43 ` Mika Westerberg
2023-01-05 17:04 ` Bjorn Helgaas
2023-01-09 11:11 ` Mika Westerberg
2023-01-09 18:27 ` Alexander Motin
2023-01-10 10:07 ` Mika Westerberg [this message]
2023-01-09 19:33 ` Alexander Motin
2023-01-10 9:54 ` Mika Westerberg
2023-01-04 9:16 ` [PATCH v4 2/2] PCI: Distribute available resources for root buses too Mika Westerberg
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=Y7042gQsfPmD+21D@black.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=chris.chiu@canonical.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mav@ixsystems.com \
--cc=nicholas.johnson-opensource@outlook.com.au \
--cc=rafael.j.wysocki@intel.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: 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