lkml.org 
[lkml]   [2012]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 09/13] PCI: Probe safe range that we can use for unassigned bridge.
From
On Mon, Jan 30, 2012 at 7:59 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Fri, Jan 27, 2012 at 6:49 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>> Try to allocate from parent bus busn_res. if can not find any big enough, will try
>> to extend parent bus top. even the extending is through allocating, after allocating
>> will pad the range to parent buses top.
>>
>> When extending happens, We will record the parent_res, so could use it as stopper
>> for really extend/shrink top later.
>>
..
>
> I think what this does is "find the largest available area in 'res'."
> That *sounds* sort of useful (and like something that could go
> somewhere more generic than drivers/pci/probe.c), but there's no
> locking, so we don't have any assurance that the area we find will
> *remain* available.

two usages:
1. init booting : should be safe, that is sequential scanning
2. hotplug: we should have overall lock somewhere for it?

>
> Since the caller should deal with failure anyway (if the largest
> available area is no longer available by the time it gets around to
> allocating it), it seems like it'd be better to fold this into the
> caller somehow.



>> +               if (ret == 0) {
>> +                       /* release busn_res */
>
> Comments like this that repeat exactly what the next line of code does
> without adding any useful information are unnecessary and distracting.

ok, will remove them.

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-01-30 19:53    [W:1.807 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site