From: Bjorn Helgaas <helgaas@kernel.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
Nicholas Johnson <nicholas.johnson-opensource@outlook.com.au>,
Logan Gunthorpe <logang@deltatee.com>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: Skip resource distribution when no hotplug bridges
Date: Wed, 26 Jun 2019 12:35:06 -0500 [thread overview]
Message-ID: <20190626173505.GB183605@google.com> (raw)
In-Reply-To: <8a53232416cce158fad35b781eb80b3ace3afc08.camel@kernel.crashing.org>
On Tue, Jun 25, 2019 at 09:45:04AM +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2019-06-24 at 14:24 +0300, Mika Westerberg wrote:
> > >
> > > I'm pretty sure this patch preserves the previous behavior of
> > > pci_bus_distribute_available_resources(), but I'm not sure that
> > > behavior is what we want.
> > >
> > > For example, in the following topology, when we process bus 10, we
> > > find two non-hotplug bridges and no hotplug bridges, so IIUC we
> > > return
> > > without distributing any resources to them. But I would think we
> > > should try to give 10:1c.0 more space if possible because it has a
> > > hotplug bridge below it.
> > >
> > > 00:1c.0: hotplug bridge to [bus 10-2f]
> > > 10:1c.0: non-hotplug bridge to [bus 11-2e]
> > > 11:00.0: hotplug bridge to [bus 12-2e]
> > > 10:1c.1: non-hotplug bridge to [bus 2f]
> >
> > Yes, I agree in this case we want to preserve more space for 10:1c.0.
>
> I sitll can't make sense of any of this stuff though.
>
> We only every distribute resources when using
> pci_assign_unassigned_bridge_resources which we only use some cases,
> and it's completely non obvious why we would use it there and not in
> other places.
>
> We also don't distribute during the initial root survey meaning afaik
> that we get toast for any hotplug bridge that has stuff already there
> at boot.
>
> Also, distributing the "available" space means we leave nothing for
> potential SR-IOV siblings... have we ended up bloting the very PCIe-
> centric assumption that it's "unlikely" that a hotplug bridge has an
> SR-IOV sibling ?
>
> This is all a terrible mess and I feel that all these little tweaks
> here or there are just making it even more impossible to completely
> grasp or predict how it will behave.
No argument about it being a mess.
I agree that tweaks clutter the history, which is definitely a
downside. Do you think these actually change the way things work or
make the code harder to read?
I think there is value in even minor simplifications that make the
code easier to understand. Small improvements compound over time and
expose opportunities for more significant improvement.
Bjorn
next prev parent reply other threads:[~2019-06-26 17:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-22 21:03 [PATCH 0/2] PCI: Simplify pci_bus_distribute_available_resources() Bjorn Helgaas
2019-06-22 21:03 ` [PATCH 1/2] " Bjorn Helgaas
2019-06-24 11:09 ` Mika Westerberg
2019-06-24 16:21 ` Logan Gunthorpe
2019-06-22 21:03 ` [PATCH 2/2] PCI: Skip resource distribution when no hotplug bridges Bjorn Helgaas
2019-06-24 11:24 ` Mika Westerberg
2019-06-24 23:45 ` Benjamin Herrenschmidt
2019-06-25 10:05 ` Mika Westerberg
2019-06-25 11:48 ` Benjamin Herrenschmidt
2019-06-25 12:04 ` Mika Westerberg
2019-06-25 12:23 ` Benjamin Herrenschmidt
2019-06-25 12:43 ` Mika Westerberg
2019-06-25 23:22 ` Benjamin Herrenschmidt
2019-06-26 17:35 ` Bjorn Helgaas [this message]
2019-06-26 22:35 ` Benjamin Herrenschmidt
2019-06-24 16:26 ` Logan Gunthorpe
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=20190626173505.GB183605@google.com \
--to=helgaas@kernel.org \
--cc=benh@kernel.crashing.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=mika.westerberg@linux.intel.com \
--cc=nicholas.johnson-opensource@outlook.com.au \
/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