From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Mike Travis <travis@sgi.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Jesse Barnes <jbarnes@virtuousgeek.org>,
Jacob Pan <jacob.jun.pan@intel.com>, Tejun Heo <tj@kernel.org>,
Mike Habeck <habeck@sgi.com>, LKML <linux-kernel@vger.kernel.org>,
Yinghai <yinghai.lu@oracle.com>,
linux-pci@vger.kernel.org, Myron Stowe <myron.stowe@hp.com>
Subject: Re: [Patch 1/1] x86 pci: Add option to not assign BAR's if not already assigned
Date: Thu, 13 May 2010 13:54:59 -0600 [thread overview]
Message-ID: <201005131354.59721.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <4BEC4F15.7060206@sgi.com>
On Thursday, May 13, 2010 01:12:21 pm Mike Travis wrote:
>
> Bjorn Helgaas wrote:
> > On Wednesday, May 12, 2010 12:14:32 pm Mike Travis wrote:
> >> Subject: [Patch 1/1] x86 pci: Add option to not assign BAR's if not already assigned
> >> From: Mike Habeck <habeck@sgi.com>
> >>
> >> The Linux kernel assigns BARs that a BIOS did not assign, most likely
> >> to handle broken BIOSes that didn't enumerate the devices correctly.
> >> On UV the BIOS purposely doesn't assign I/O BARs for certain devices/
> >> drivers we know don't use them (examples, LSI SAS, Qlogic FC, ...).
> >> We purposely don't assign these I/O BARs because I/O Space is a very
> >> limited resource. There is only 64k of I/O Space, and in a PCIe
> >> topology that space gets divided up into 4k chucks (this is due to
> >> the fact that a pci-to-pci bridge's I/O decoder is aligned at 4k)...
> >> Thus a system can have at most 16 cards with I/O BARs: (64k / 4k = 16)
> >>
> >> SGI needs to scale to >16 devices with I/O BARs. So by not assigning
> >> I/O BARs on devices we know don't use them, we can do that (iff the
> >> kernel doesn't go and assign these BARs that the BIOS purposely didn't
> >> assign).
> >
> > I don't quite understand this part. If you boot with "pci=nobar",
> > the BIOS doesn't assign BARs, Linux doesn't either, the drivers
> > don't need them -- everything works, and that makes sense so far.
> >
> > Now, if you boot normally (without "pci=nobar"), what changes?
> > The BIOS situation is the same, but Linux tries to assign the
> > unassigned BARs. It may assign a few before running out of space,
> > but the drivers still don't need those BARs. What breaks?
>
> The problem arises because we run out of address spaces to assign.
>
> Say you have 24 cards, and the 1st 16 do not use I/O BARs. If
> you assign the available 16 address spaces to cards that may not
> need them, then the final 8 cards will not be available.
It sounds like your BIOS treats some devices specially, so I assumed
it would leave the first sixteen devices unassigned, but would assign
the last eight, including the bridge windows leading to them. In that
case, I would expect Linux to preserve the resources of the last
eight devices, since they're already assigned, and assign anything
left over to the first sixteen.
Are you saying that Linux clobbers the resources of the last eight
devices in the process of assigning the first sixteen? If so, I'd
say that's a Linux bug.
Or are the last eight hot-added cards that the BIOS never had a
chance to assign? That's definitely a problem.
> > Can't we figure out whether we need this ourselves? Using a command-
> > line option just guarantees that we'll forever be writing customer
> > advisories about this issue.
>
> I think since this is so specific (like the potential of having
> more than 16 cards would be something the customer would know),
> I think it's better to error on the safe side. If a BIOS does
> not recognize an add in card (for whatever reason), and does
> not assign the I/O BAR, then it would be up to the kernel to
> do that. Wouldn't you get more customer complaints about non-working
> I/O, than someone with > 16 PCI cards not being able to use them
> all?
It feels specific now, but in five years, I bet it won't be so
unusual. I really don't want to force customers to figure out
when they need this.
> > This issue is not specific to x86, so I don't really like having
> > the implementation be x86-specific.
>
> We were going for as light a touch as possible, as there is not
> time to verify other arches. I'd be glad to submit a follow on
> patch dealing with the generic case and depend on others for
> testing, if that's of interest.
It's of interest to me. I spend a lot of time pulling generic
out of architecture-specific places. If there's stuff that we
know is generic from the beginning, we shouldn't make work for
ourselves by making it x86-specific.
> > I'm a little bit nervous about Linux's current strategy of assigning
> > resources to things before we even know whether we're going to use
> > them. We don't support dynamic PCI resource reassignment, so maybe
> > we don't have any choice in this case, but generally I prefer the
> > lazy approach.
>
> That's a great idea if it can work. Unfortunately, we are all tied
> to the way BIOS sets up the system, and for UV systems I don't think
> dynamic provisioning would work. There's too much infrastructure
> that all has to cooperate by the time the system is fully functional.
Like I said, we maybe don't have a choice in this case, but I'd like
to have a clearer understanding of the problem and how other OSes
deal with it before we start applying band-aids that will hurt when
we pull them off later.
Bjorn
next prev parent reply other threads:[~2010-05-13 19:55 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-12 18:14 Mike Travis
2010-05-13 18:56 ` Bjorn Helgaas
2010-05-13 19:08 ` H. Peter Anvin
2010-05-13 19:12 ` Mike Travis
2010-05-13 19:13 ` Mike Travis
2010-05-13 19:54 ` Bjorn Helgaas [this message]
2010-05-13 20:27 ` Mike Habeck
2010-05-13 19:38 ` Mike Habeck
2010-05-13 20:02 ` Bjorn Helgaas
2010-05-13 20:09 ` H. Peter Anvin
2010-05-14 22:25 ` Jesse Barnes
2010-05-14 22:34 ` Mike Travis
2010-05-14 22:35 ` H. Peter Anvin
2010-05-14 22:40 ` Mike Travis
2010-05-15 2:25 ` Mike Travis
2010-05-14 22:47 ` Jesse Barnes
2010-05-14 22:59 ` Mike Travis
2010-05-14 23:06 ` Jesse Barnes
2010-05-14 23:23 ` Mike Travis
2010-05-14 23:33 ` Jesse Barnes
2010-05-14 23:40 ` H. Peter Anvin
2010-05-15 0:02 ` Jesse Barnes
2010-05-14 23:20 ` H. Peter Anvin
2010-05-14 23:28 ` Jesse Barnes
2010-05-14 23:32 ` H. Peter Anvin
2010-05-14 23:34 ` Jesse Barnes
2010-05-14 23:39 ` H. Peter Anvin
2010-05-15 0:00 ` Jesse Barnes
2010-05-15 0:14 ` H. Peter Anvin
2010-05-13 20:36 ` Yinghai Lu
2010-05-13 20:34 ` H. Peter Anvin
2010-05-13 18:58 ` Bjorn Helgaas
2010-05-28 16:53 ` Mike Travis
2010-05-28 17:00 ` H. Peter Anvin
2010-05-28 17:10 ` Mike Travis
2010-05-28 19:28 ` Jesse Barnes
2010-05-28 20:04 ` H. Peter Anvin
2010-05-31 11:12 ` Mike Travis
2010-05-31 16:36 ` H. Peter Anvin
2010-06-01 22:49 ` Bjorn Helgaas
2010-06-02 7:31 ` H. Peter Anvin
2010-06-02 15:45 ` Bjorn Helgaas
2010-06-02 15:47 ` H. Peter Anvin
2010-06-02 15:53 ` Jesse Barnes
2010-06-09 0:53 ` H. Peter Anvin
2010-06-09 1:26 ` Jesse Barnes
2010-06-09 14:23 ` Mike Habeck
2010-06-02 15:53 ` Mike Habeck
2010-06-02 16:40 ` Bjorn Helgaas
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=201005131354.59721.bjorn.helgaas@hp.com \
--to=bjorn.helgaas@hp.com \
--cc=habeck@sgi.com \
--cc=hpa@zytor.com \
--cc=jacob.jun.pan@intel.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=myron.stowe@hp.com \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=travis@sgi.com \
--cc=x86@kernel.org \
--cc=yinghai.lu@oracle.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
all inboxes | Powered by JetHome®