From: Guo Chao <yan@linux.vnet.ibm.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Yinghai Lu <yinghai@kernel.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Wei Yang <weiyang@linux.vnet.ibm.com>,
Gavin Shan <shangw@linux.vnet.ibm.com>,
Jack Morgenstein <jackm@dev.mellanox.co.il>,
Amir Vadai <amirv@mellanox.com>,
Or Gerlitz <ogerlitz@mellanox.com>,
Eugenia Emantayev <eugenia@mellanox.com>,
talal@mellanox.com,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH v7] PCI: Try best to allocate pref mmio 64bit above 4g
Date: Wed, 9 Apr 2014 15:52:15 +0800 [thread overview]
Message-ID: <20140409075215.GA3173@yanx> (raw)
In-Reply-To: <CAErSpo4JSrjSn4dXC9Pzfz2Aho+W4Gq9uKc+kAFbqTERcRAJ+w@mail.gmail.com>
Hi, Bjorn:
On Tue, Apr 08, 2014 at 09:02:10AM -0600, Bjorn Helgaas wrote:
> On Mon, Apr 7, 2014 at 8:57 PM, Guo Chao <yan@linux.vnet.ibm.com> wrote:
> > On Fri, Apr 04, 2014 at 04:43:27PM -0600, Bjorn Helgaas wrote:
> >> On Fri, Mar 7, 2014 at 1:08 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> >> > When one of children resources does not support MEM_64, MEM_64 for
> >> > bridge get reset, so pull down whole pref resource on the bridge under 4G.
> >> >
> >> > If the bridge support pref mem 64, will only allocate that with pref mem64 to
> >> > children that support it.
> >> > For children resources if they only support pref mem 32, will allocate them
> >> > from non pref mem instead.
> >> >
> >> > If the bridge only support 32bit pref mmio, will still have all children pref
> >> > mmio under that.
> >> >
> >> > -v2: Add release bridge res support with bridge mem res for pref_mem children res.
> >> > -v3: refresh and make it can be applied early before for_each_dev_res patchset.
> >> > -v4: fix non-pref mmio 64bit support found by Guo Chao.
> >> > -v7: repost as ibm's powerpc system work again when
> >> > 1. petiboot boot kernel have this patch.
> >> > 2. or mellanox driver added new .shutdown member.
> >> > discussion could be found at:
> >> > http://marc.info/?t=138968064500001&r=1&w=2
> >>
> >> I think this fixes some sort of bug, and I suppose if I spent a few
> >> hours decoding the discussion you mention (the 44 message-long
> >> "mlx4_core probe error after applying Yinghai's patch" discussion), I
> >> might be able to figure out what it is.
> >>
> >
> > The result of 44 message-long discussion is: the Mellanox card's failure is
> > due to a bug in its driver instead of this patch.
> >
> > The patch refines the logic of using prefetchable window, so that 64-bit
> > prefetchable BARs have a chance to be really prefetchable. It does not fix
> > any bugs, instead, it exposes one.
>
> OK, then I'm back to square one, and I need an explanation of why we
> want to merge this patch.
>
> I think the patch conserves 32-bit address space by putting more
> things above 4G than we used to. But this comes at the cost of using
> non-prefetchable windows in some cases where we used to use
> prefetchable ones.
>
> Somebody has to explain why we want to do this and why the benefit of
> conserving the 32-bit space is more important losing the
> prefetchability.
I want to make sure we are talking about this patch:
PCI: Try best to allocate pref mmio 64bit above 4g
http://patchwork.ozlabs.org/patch/328067/
instead of this one:
PCI: Try to allocate mem64 above 4G at first
http://patchwork.ozlabs.org/patch/303197/
This patch does not intend to conserve 32-bit space at all. It makes
better use of prefetchable window.
The problem with the old code is: when both 32-bit and 64-bit prefetchable
BARs present, it's in favor of 32-bit one to use prefetchable window.
This window is then not supposed to get 4G-above address, and this
32-bit-address-only property would propagates upwards until reaching root
bridge. In later assignment phase, 4G-above space is never touched. This
is just caused by a single 32-bit prefetchable BAR (say a ROM BAR).
This patch helps by making better decision:
* Keep the old behaviour if only 32-bit or 64-bit prefetchable
BARs present
* If both of them present, put 64-bit ones to prefetchable window,
32-bit ones to non-prefetchable window
So 4G-above space can be properly used.
Why does enabling 64-bit space matter?
* 32-bit space is just too small. If larger-than-4G BAR sounds
unrealistic (we do have such devices), there is still a chance that
total MMIO size under a domain is too large, especially when SR-IOV
enabled (we met this situation).
* On PowerNV platform, we can do better platform configuration for 64-bit
prefetchable space, that's important for enabling SR-IOV on this
platform.
Thanks,
Guo Chao
>
> Bjorn
>
next prev parent reply other threads:[~2014-04-09 7:52 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAE9FiQXzRQ9S0mwwb58R2icBTtHHJ6NMVFMaxEgtVNP9mZVjZw@mail.gmail.com>
2014-03-07 20:08 ` [PATCH v7] PCI: Try best to allocate pref mmio 64bit above 4g Yinghai Lu
2014-04-04 22:43 ` Bjorn Helgaas
2014-04-08 2:57 ` Guo Chao
2014-04-08 7:18 ` Or Gerlitz
2014-04-08 7:41 ` Wei Yang
2014-04-08 7:55 ` Or Gerlitz
2014-04-08 8:22 ` Guo Chao
2014-04-08 15:02 ` Bjorn Helgaas
2014-04-09 7:52 ` Guo Chao [this message]
2014-04-10 17:26 ` Bjorn Helgaas
2014-04-10 21:23 ` Benjamin Herrenschmidt
2014-04-15 11:54 ` Guo Chao
2014-04-16 0:09 ` Bjorn Helgaas
2014-04-16 2:29 ` Yinghai Lu
2014-04-16 17:06 ` Bjorn Helgaas
2014-04-17 3:30 ` Yinghai Lu
2014-04-16 4:16 ` Yinghai Lu
2014-04-16 17:10 ` Bjorn Helgaas
2014-04-16 6:30 ` Benjamin Herrenschmidt
2014-04-16 6:33 ` Benjamin Herrenschmidt
2014-04-16 17:15 ` Bjorn Helgaas
2014-04-16 22:11 ` Bjorn Helgaas
2014-04-17 4:20 ` Yinghai Lu
2014-04-17 16:35 ` Yinghai Lu
2014-04-17 4:23 ` [PATCH v8] " Yinghai Lu
2014-04-17 16:40 ` [PATCH v9] " Yinghai Lu
2014-05-20 3:45 ` [PATCH v10 0/4] PCI: Restrict 64-bit prefetchable bridge windows to 64-bit resources Bjorn Helgaas
2014-05-20 3:45 ` [PATCH v10 1/4] " Bjorn Helgaas
2014-05-20 3:45 ` [PATCH v10 2/4] PCI: Change pbus_size_mem() return values to be more conventional Bjorn Helgaas
2014-05-22 8:20 ` Wei Yang
2014-05-22 16:59 ` Bjorn Helgaas
2014-05-20 3:46 ` [PATCH v10 3/4] PCI: Simplify __pci_assign_resource() coding style Bjorn Helgaas
2014-05-20 3:46 ` [PATCH v10 4/4] PCI: Add resource allocation comments Bjorn Helgaas
2014-05-21 3:31 ` [PATCH v10 0/4] PCI: Restrict 64-bit prefetchable bridge windows to 64-bit resources Wei Yang
2014-05-21 4:36 ` 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=20140409075215.GA3173@yanx \
--to=yan@linux.vnet.ibm.com \
--cc=amirv@mellanox.com \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=eugenia@mellanox.com \
--cc=jackm@dev.mellanox.co.il \
--cc=linux-pci@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=shangw@linux.vnet.ibm.com \
--cc=talal@mellanox.com \
--cc=weiyang@linux.vnet.ibm.com \
--cc=yinghai@kernel.org \
/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).