[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1307739165.2872.12.camel@edumazet-laptop>
Date: Fri, 10 Jun 2011 22:52:45 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: linux-kernel@...r.kernel.org, tglx@...utronix.de,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 1/3] posix-timers: remove idr_lock
Le vendredi 10 juin 2011 à 22:44 +0200, Andi Kleen a écrit :
> On Fri, Jun 10, 2011 at 10:40:38PM +0200, Eric Dumazet wrote:
> > Le vendredi 10 juin 2011 à 13:13 -0700, Andi Kleen a écrit :
> > > From: Andi Kleen <ak@...ux.intel.com>
> > >
> > > idr_lock is only used to protect the global posix_timers idr,
> > > but idr does its own locking (or RCUing) anyways and doesn't
> > > need it. So remove it.
> >
> > Are you sure of this assertion Andi ?
> >
> > I believe we need an external synchronization before calling
> > idr_remove() / idr_get_new()
>
> idr has its own lock and from a quick check it seemed to always
> take it when needed. Also ipc/* don't take a lock for this as far
> as I can see, and I think RCU idr was designed for that.
>
I dont think so. Just read idr_remove() code : its obviously unsafe.
RCU permits readers to only hold rcu_read_lock()
But writers need their (external) synchronization.
--
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