[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161214171252.GP1402@wotan.suse.de>
Date: Wed, 14 Dec 2016 18:12:52 +0100
From: "Luis R. Rodriguez" <mcgrof@...nel.org>
To: Petr Mladek <pmladek@...e.com>
Cc: "Luis R. Rodriguez" <mcgrof@...nel.org>, shuah@...nel.org,
jeyu@...hat.com, rusty@...tcorp.com.au, ebiederm@...ssion.com,
dmitry.torokhov@...il.com, acme@...hat.com, corbet@....net,
martin.wilck@...e.com, mmarek@...e.com, hare@...e.com,
rwright@....com, jeffm@...e.com, DSterba@...e.com,
fdmanana@...e.com, neilb@...e.com, linux@...ck-us.net,
rgoldwyn@...e.com, subashab@...eaurora.org, xypron.glpk@....de,
keescook@...omium.org, atomlin@...hat.com, mbenes@...e.cz,
paulmck@...ux.vnet.ibm.com, dan.j.williams@...el.com,
jpoimboe@...hat.com, davem@...emloft.net, mingo@...hat.com,
akpm@...ux-foundation.org, torvalds@...ux-foundation.org,
linux-kselftest@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC 06/10] kmod: provide sanity check on kmod_concurrent access
On Wed, Dec 14, 2016 at 05:08:58PM +0100, Petr Mladek wrote:
> On Thu 2016-12-08 11:48:50, Luis R. Rodriguez wrote:
> > Only decrement *iff* we're possitive. Warn if we've hit
> > a situation where the counter is already 0 after we're done
> > with a modprobe call, this would tell us we have an unaccounted
> > counter access -- this in theory should not be possible as
> > only one routine controls the counter, however preemption is
> > one case that could trigger this situation. Avoid that situation
> > by disabling preemptiong while we access the counter.
>
> I am curious about it. How could enabled preemption cause that
> the counter will get negative?
As the commit log describes today in theory this is not possible
was we have only have one routine controlling the counter. If we
were to expand this then such possibilities become more real.
> Unaccounted access would be possible if put() is called
> without get() or if put() is called before get().
Exactly, so buggy users of the get/put calls in future calls.
I can just drop the preemption disable / enable for now as it
should not be an issue now.
> I do not see a way how the value might get negative when
> the calls are paired and ordered.
Right, this just matches parity with module_put(), its perhaps
*preemptively* too cautious though so I could just drop the
preemption enable/disable for now as that would slow down
things a bit.
Luis
Powered by blists - more mailing lists