Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-16 Thread Veaceslav Falico
On Wed, Apr 17, 2013 at 01:25:13PM +0930, Rusty Russell wrote: Veaceslav Falico writes: Tested for a day on two reproducers on the latest upstream kernel, with the recent kobject fix a49b7e82 ("kobject: fix kset_find_obj() race with concurrent last kobject_put()") - it fixes the issue, no regre

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-16 Thread Rusty Russell
Veaceslav Falico writes: > Tested for a day on two reproducers on the latest upstream kernel, with the > recent kobject fix a49b7e82 ("kobject: fix kset_find_obj() race with > concurrent last kobject_put()") - it fixes the issue, no regressions met. Thanks, I've included the fix in my modules-nex

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-16 Thread Veaceslav Falico
On Mon, Apr 15, 2013 at 11:56:03AM +0930, Rusty Russell wrote: Veaceslav Falico writes: On Wed, Apr 10, 2013 at 04:47:34PM +0930, Rusty Russell wrote: That's a bug. We should be cleaning up sysfs before we unlike the removed module from the list. Because the same thing applies to ddebug info

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-14 Thread Rusty Russell
Veaceslav Falico writes: > On Wed, Apr 10, 2013 at 04:47:34PM +0930, Rusty Russell wrote: >>That's a bug. We should be cleaning up sysfs before we unlike the >>removed module from the list. >> >>Because the same thing applies to ddebug info, which is also keyed by >>module name. >> >>Something li

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-11 Thread Veaceslav Falico
On Thu, Apr 11, 2013 at 08:20:03AM -0700, Greg KH wrote: On Thu, Apr 11, 2013 at 03:53:40PM +0200, Veaceslav Falico wrote: On Thu, Apr 11, 2013 at 06:28:31AM -0700, Greg KH wrote: >On Thu, Apr 11, 2013 at 11:55:37AM +0200, Veaceslav Falico wrote: ... In both examples we don't look at that kob

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-11 Thread Greg KH
On Thu, Apr 11, 2013 at 03:53:40PM +0200, Veaceslav Falico wrote: > On Thu, Apr 11, 2013 at 06:28:31AM -0700, Greg KH wrote: > >On Thu, Apr 11, 2013 at 11:55:37AM +0200, Veaceslav Falico wrote: > >>However, I think my patch still adds something good, cause now we have 2 > >>cases where we basically

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-11 Thread Veaceslav Falico
On Thu, Apr 11, 2013 at 06:28:31AM -0700, Greg KH wrote: On Thu, Apr 11, 2013 at 11:55:37AM +0200, Veaceslav Falico wrote: However, I think my patch still adds something good, cause now we have 2 cases where we basically do: k = kset_find_obj(); if (!k) return; kobject_put(k); which ad

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-11 Thread Greg KH
On Thu, Apr 11, 2013 at 11:55:37AM +0200, Veaceslav Falico wrote: > However, I think my patch still adds something good, cause now we have 2 > cases where we basically do: > > k = kset_find_obj(); > if (!k) > return; > kobject_put(k); > > which adds useless overhead (by using kobject_get()/

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-11 Thread Veaceslav Falico
On Wed, Apr 10, 2013 at 04:47:34PM +0930, Rusty Russell wrote: Veaceslav Falico writes: Add a new function, kset_obj_exists(), which is identical to kset_find_obj() but doesn't take a reference to the kobject found and only returns bool if found/not found. The main purpose would be to avoid th

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-10 Thread Veaceslav Falico
On Thu, Apr 11, 2013 at 11:28:06AM +0930, Rusty Russell wrote: Greg KH writes: On Tue, Apr 09, 2013 at 01:22:09PM +0200, Veaceslav Falico wrote: Add a new function, kset_obj_exists(), which is identical to kset_find_obj() but doesn't take a reference to the kobject found and only returns bool

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-10 Thread Rusty Russell
Greg KH writes: > On Tue, Apr 09, 2013 at 01:22:09PM +0200, Veaceslav Falico wrote: >> Add a new function, kset_obj_exists(), which is identical to >> kset_find_obj() but doesn't take a reference to the kobject >> found and only returns bool if found/not found. >> >> The main purpose would be to

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-10 Thread Greg KH
On Tue, Apr 09, 2013 at 01:22:09PM +0200, Veaceslav Falico wrote: > Add a new function, kset_obj_exists(), which is identical to > kset_find_obj() but doesn't take a reference to the kobject > found and only returns bool if found/not found. > > The main purpose would be to avoid the possible race

Re: [PATCH] module: add kset_obj_exists() and use it

2013-04-10 Thread Rusty Russell
Veaceslav Falico writes: > Add a new function, kset_obj_exists(), which is identical to > kset_find_obj() but doesn't take a reference to the kobject > found and only returns bool if found/not found. > > The main purpose would be to avoid the possible race scenario, > when we could get the referen

[PATCH] module: add kset_obj_exists() and use it

2013-04-09 Thread Veaceslav Falico
Add a new function, kset_obj_exists(), which is identical to kset_find_obj() but doesn't take a reference to the kobject found and only returns bool if found/not found. The main purpose would be to avoid the possible race scenario, when we could get the reference in between the kref_put() and kobj