[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1296036656.28776.1137.camel@laptop>
Date: Wed, 26 Jan 2011 11:10:56 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
linux-mm@...ck.org, Arnaldo Carvalho de Melo <acme@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Christoph Hellwig <hch@...radead.org>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
SystemTap <systemtap@...rces.redhat.com>,
Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Andi Kleen <andi@...stfloor.org>,
LKML <linux-kernel@...r.kernel.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [RFC] [PATCH 2.6.37-rc5-tip 5/20] 5: Uprobes:
register/unregister probes.
On Wed, 2011-01-26 at 13:17 +0530, Srikar Dronamraju wrote:
> * Peter Zijlstra <peterz@...radead.org> [2011-01-25 13:15:45]:
>
> > > +
> > > + if (atomic_read(&uprobe->ref) == 1) {
> > > + synchronize_sched();
> > > + rb_erase(&uprobe->rb_node, &uprobes_tree);
> >
> > How is that safe without holding the treelock?
>
> Right,
> Something like this should be good enuf right?
>
> if (atomic_read(&uprobe->ref) == 1) {
> synchronize_sched();
> spin_lock_irqsave(&treelock, flags);
> rb_erase(&uprobe->rb_node, &uprobes_tree);
> spin_lock_irqrestore(&treelock, flags);
> iput(uprobe->inode);
> }
>
How is the atomic_read() not racy with a future increment, and what is
that synchronize_sched() thing for?
--
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