Re: [PATCH -v12 02/15] resources: Add probe_resource()

2012-08-30 Thread Bjorn Helgaas
On Wed, Aug 29, 2012 at 10:36 AM, Yinghai Lu wrote: > On Wed, Aug 29, 2012 at 8:57 AM, Yinghai Lu wrote: >> also have another version for probe_resource, please check attached version >> -v8. >> > > sorry, v8 forget removing two lines. > > please -v9 instead. > > -v8: Linus said: allocation/retu

Re: [PATCH -v12 02/15] resources: Add probe_resource()

2012-08-29 Thread Yinghai Lu
On Wed, Aug 29, 2012 at 8:57 AM, Yinghai Lu wrote: > also have another version for probe_resource, please check attached version > -v8. > sorry, v8 forget removing two lines. please -v9 instead. -v8: Linus said: allocation/return is not right, and -1 step tricks make it not work as gen

Re: [PATCH -v12 02/15] resources: Add probe_resource()

2012-08-29 Thread Yinghai Lu
On Wed, Aug 29, 2012 at 3:14 AM, Ram Pai wrote: > @@ -718,12 +727,12 @@ void insert_resource_expand_to_fit(struct resource > *root, struct resource *new) > */ > int adjust_resource(struct resource *res, resource_size_t start, > resource_size_t size) > { > - struct resource *tmp, *paren

Re: [PATCH -v12 02/15] resources: Add probe_resource()

2012-08-29 Thread Yinghai Lu
On Tue, Aug 28, 2012 at 5:10 PM, Linus Torvalds wrote: > On Tue, Aug 28, 2012 at 10:05 AM, Linus Torvalds > wrote: >> >> Ugh. Ok, looking closer at this, > > Btw, looking at that code, I also found what looks like a potential > locking bug in allocate_resource(). > > The code does > > if (new

Re: [PATCH -v12 02/15] resources: Add probe_resource()

2012-08-29 Thread Ram Pai
On Tue, Aug 28, 2012 at 05:10:43PM -0700, Linus Torvalds wrote: > On Tue, Aug 28, 2012 at 10:05 AM, Linus Torvalds > wrote: > > > > Ugh. Ok, looking closer at this, > > Btw, looking at that code, I also found what looks like a potential > locking bug in allocate_resource(). > > The code does >

Re: [PATCH -v12 02/15] resources: Add probe_resource()

2012-08-28 Thread Linus Torvalds
On Tue, Aug 28, 2012 at 10:05 AM, Linus Torvalds wrote: > > Ugh. Ok, looking closer at this, Btw, looking at that code, I also found what looks like a potential locking bug in allocate_resource(). The code does if (new->parent) .. reallocate .. to check whether a resource was alread

Re: [PATCH -v12 02/15] resources: Add probe_resource()

2012-08-28 Thread Linus Torvalds
On Tue, Aug 28, 2012 at 9:09 AM, Yinghai Lu wrote: > > please check update one. -v7 Ugh. Ok, looking closer at this, I think I agree with Bjorn. This is too ugly. The whole "reduce size/needed_size by 1" double loop is O(n**2). And it does ugly "insert fake resource to check, and then remove it"

Re: [PATCH -v12 02/15] resources: Add probe_resource()

2012-08-28 Thread Yinghai Lu
On Tue, Jun 26, 2012 at 3:07 PM, Yinghai Lu wrote: > On Tue, Jun 26, 2012 at 11:53 AM, Yinghai Lu wrote: >> It is changed from busn_res only version, because Bjorn found that version >> was not holding resource_lock. >> Even it may be ok for busn_res not holding resource_lock. >> It would be bett