All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Yang <weiyang@linux.vnet.ibm.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Richard Yang <weiyang@linux.vnet.ibm.com>,
	Wei Yang <weiyang.kernel@gmail.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: One problem in reassign pci bus number?
Date: Thu, 10 May 2012 11:35:51 +0800	[thread overview]
Message-ID: <20120510033551.GA25138@richard> (raw)
In-Reply-To: <CAE9FiQUU+a4yQJTiud=aYx2xXcoQZpH2rJyVhj19TQKGN7=2BA@mail.gmail.com>

On Mon, May 07, 2012 at 08:42:59PM -0700, Yinghai Lu wrote:
>>>no, probe_resource will get from start if space is big enough.
>>>
>>>if not, it will try to extend top.
>>
>> Hmm... for example we still have this
>>               parent[70-160]
>> brother1[70-80]  res[90-150]  brother2[151-160]
>>                   ->child[105-140]
>>
>> if we call probe_resource(res, new_res, 16, par, 1, 0xff,
>> IORESOURCE_PCI_FIXED);
>>
>> I think this call is used to allocate a res of size 16 under res.
>> When there is no enough free space, it will expend res, and res->parent.
>>
>> While in this situation, res doesn't have enough free space. so it need
>> to expend itself.
>>
>> In the probe_resource() it tries to extend res on the right side.
>> So even there is enough space between brother1 and res, I think the
>> probe_resource() will not return 0.
>>
>> Do you think my analysis is correct?
>
>it will reduce needed size one by one. so at last it will return
>[91, 104]
Yes, agree. This is the current behavior.

While in this case.
               70-160]
 brother1[70-80]  res[90-150]  brother151-160]
                   ->child

There is free space between 81-89, and 90-104. These two free range add
up to 25, which is more than the required space, 16.

If we have this resource tree. 
          parent[70-180]
 brother1[70-80]  re[90-150]  brothr2[170-180]
                 d[105-140]

There are enough free space between res and brother2.
Then probe_resource will return [141-156] with size 16. 
And also expend res.

So I mean this is the design decision to not count in the free space on
the left? Even there is enough free space?

>
>Yinghai

-- 
Richard Yang
Help you, Help me


  reply	other threads:[~2012-05-10  3:36 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120410090306.GA7056@richard>
2012-04-22 15:52 ` One problem in reassign pci bus number? Richard Yang
2012-04-23 19:46   ` Don Dutile
2012-04-23 20:19     ` Yinghai Lu
2012-04-23 21:09       ` Don Dutile
2012-04-23 22:07         ` Yinghai Lu
2012-04-25  2:56           ` Don Dutile
2012-04-23 22:22         ` Yinghai Lu
2012-04-25  2:59           ` Don Dutile
2012-04-24  7:29     ` Richard Yang
2012-05-14  1:55     ` Richard Yang
2012-05-14  5:40       ` Yinghai Lu
2012-05-14  6:46         ` Richard Yang
2012-05-15 17:32           ` Yinghai Lu
2012-05-16  1:18             ` Richard Yang
2012-05-16  2:11               ` Yinghai Lu
2012-05-29 11:59                 ` Richard Yang
2012-05-29 17:14                   ` Yinghai Lu
2012-06-04 13:34                     ` Richard Yang
2012-06-04 23:36                       ` Yinghai Lu
2012-06-05  6:26                         ` Richard Yang
2012-06-05 18:01                           ` Yinghai Lu
2012-04-23 20:13   ` Yinghai Lu
2012-04-24 14:56     ` Wei Yang
2012-04-25  9:47     ` Wei Yang
2012-04-25 16:28       ` Yinghai Lu
2012-05-03  6:54         ` Richard Yang
2012-05-03  8:33           ` Yinghai Lu
2012-05-04  2:47             ` Richard Yang
2012-05-04  3:15               ` Yinghai Lu
2012-05-04  4:52                 ` Richard Yang
2012-05-04 17:37                   ` Yinghai Lu
2012-05-06 15:17                     ` Richard Yang
2012-05-06 16:35                       ` Yinghai Lu
2012-05-06 16:36                         ` Yinghai Lu
2012-05-07  1:17                           ` Richard Yang
2012-05-07  2:04                             ` Yinghai Lu
2012-05-08  2:46                               ` Richard Yang
2012-05-08  3:42                                 ` Yinghai Lu
2012-05-10  3:35                                   ` Richard Yang [this message]
2012-05-10  5:42                                     ` Yinghai Lu
2012-05-11  1:23                                       ` 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=20120510033551.GA25138@richard \
    --to=weiyang@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=weiyang.kernel@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.