linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <shangw@linux.vnet.ibm.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Ram Pai <linuxram@us.ibm.com>,
	Richard Yang <weiyang@linux.vnet.ibm.com>,
	linux-pci@vger.kernel.org
Subject: Re: One chart on pci bridge and its bus and their children
Date: Wed, 6 Jun 2012 06:52:11 +0900	[thread overview]
Message-ID: <20120605215211.GA5564@shangw> (raw)
In-Reply-To: <CAE9FiQUCV1+ePfyX7bqOyZ+Wcsj1neCO91MvuM5vNh3+UPERDQ@mail.gmail.com>


Hi YingHai,

>>> That's true, but I don't think it answers the question.  If we have:
>>>
>>>    pci_bus->bridge == pci_bus->self->dev
>>>
>>> why would we need both "self" and "bridge"?  It would be interesting
>>> to try to remove "bridge" and replace uses of it with "self->dev".
>>
>> then how about root bus?
>>
>> root bus ->self should be NULL.
>>
>> root bus ->bridge is to the hostbridge->dev.

As I understood, the current implementation is to trace the PCI host bridge
through the PCI root bus. The problem would be avoided if you change it for
a little bit to trace the PCI host bridge through (PCI domain number), which
will simplify the current implementation in 3.5.RC1 as well even though not
much. For example: When looking for the PCI host bridge for the child bus,
we only need get the PCI domain number, then get the corresponding PCI host
bridge. We needn't go through the whole PCI bus tree from the bottom to the
top until the PCI root bus.

I'm not sure that will introduce performance improvement or not.

>
>also
>
>b->bridge = get_device(&bridge->dev);
>
>so there is one reference held by pci bus.
>

If we ignore the return value of get_device() here, that would be possible
to merge "bridge"/"self" for child PCI bus. However, we still need differentiate
the PCI root bus and child bus because the "bridge"/"self" of PCI root bus
would be "NULL", but "bridge"/"self" (might be merged to "bridge") would point
pci_dev of the P2P bridge.

Thanks,
Gavin


  parent reply	other threads:[~2012-06-05 21:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05  3:26 One chart on pci bridge and its bus and their children Richard Yang
2012-06-05  4:11 ` Ram Pai
2012-06-05  4:37   ` Bjorn Helgaas
2012-06-05  5:18     ` Yinghai Lu
2012-06-05  5:20       ` Yinghai Lu
2012-06-05  5:41         ` Richard Yang
2012-06-05  6:35         ` Ram Pai
2012-06-05 14:41           ` Jiang Liu
2012-06-05 16:40             ` Ram Pai
2012-06-06  1:58               ` Ram Pai
2012-06-05 19:38           ` Yinghai Lu
2012-06-06  5:28             ` Richard Yang
2012-06-06  7:58               ` Richard Yang
2012-06-05 21:52         ` Gavin Shan [this message]
2012-06-05  6:02       ` Richard Yang
2012-06-05 14:32         ` Jiang Liu
2012-06-05 14:37         ` Jiang Liu
2012-06-05 19:41         ` Yinghai Lu
2012-06-05  5:33   ` Richard Yang

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=20120605215211.GA5564@shangw \
    --to=shangw@linux.vnet.ibm.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxram@us.ibm.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).