[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19f34abd0804021031j3e8ecd91pf7a481a92114dda8@mail.gmail.com>
Date: Wed, 2 Apr 2008 19:31:51 +0200
From: "Vegard Nossum" <vegard.nossum@...il.com>
To: paulmck@...ux.vnet.ibm.com
Cc: "Pekka Enberg" <penberg@...helsinki.fi>,
"Ingo Molnar" <mingo@...e.hu>,
"Jens Axboe" <jens.axboe@...cle.com>,
"Peter Zijlstra" <a.p.zijlstra@...llo.nl>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Subject: Re: kmemcheck caught read from freed memory (cfq_free_io_context)
On Wed, Apr 2, 2008 at 6:59 PM, Paul E. McKenney
<paulmck@...ux.vnet.ibm.com> wrote:
> On Wed, Apr 02, 2008 at 06:15:52PM +0200, Vegard Nossum wrote:
> > On Wed, Apr 2, 2008 at 6:08 PM, Paul E. McKenney
> > <paulmck@...ux.vnet.ibm.com> wrote:
> > > On Wed, Apr 02, 2008 at 02:01:13PM +0300, Pekka Enberg wrote:
> > > > No, kmemcheck is work in progress and does not know about
> > > > SLAB_DESTROY_BY_RCU yet. The reason I asked Vegard to post the warning
> > > > was because Peter, Vegard, and myself identified this particular
> > > > warning as a real problem. But yeah, kmemcheck can cause false
> > > > positives for RCU for now.
> > >
> > > Would the following be an appropriate fix? It seems to me to be in
> > > the same spirit as the existing check for s->ctor.
> >
> > In my opinion, no.
> >
> > It would fix the false positives, but would in fact also hide cases
> > such as this one with cfq, e.g. the real cases of mis-use.
>
> Though this case apparently does not qualify as misuse until such
> time as CLONE_IO is implemented.
>
> And doesn't the current check for ->ctor also potentially hide misuse?
Hm, no. Objects with a ctor should retain its "initializedness"
between allocations of the same object. This is one of the features of
slab allocation.
> > Peter Zijlstra suggested this:
> > > It would have to register an call_rcu callback itself in order to mark
> > > it freed - and handle the race with the object being handed out again.
>
> Glad you liked them!
>
> And Peter's suggested approach would indeed be more accurate. But I
> will still put my patch forward as a stopgap. ;-)
Yes, I realize that it will be needed as a temporary fix. It _is_
better to hide some real warnings in favour of the showing false ones.
(But a TODO comment is in order, I believe.)
Thanks.
Vegard
--
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