lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Jan 2012 10:51:30 -0800
From:	Yinghai Lu <yinghai@...nel.org>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Tony Luck <tony.luck@...el.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-arch@...r.kernel.org
Subject: Re: [PATCH 09/13] PCI: Probe safe range that we can use for
 unassigned bridge.

On Mon, Jan 30, 2012 at 7:59 AM, Bjorn Helgaas <bhelgaas@...gle.com> wrote:
> On Fri, Jan 27, 2012 at 6:49 PM, Yinghai Lu <yinghai@...nel.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ