From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853Ab1AZIrn (ORCPT ); Wed, 26 Jan 2011 03:47:43 -0500 Received: from e31.co.us.ibm.com ([32.97.110.149]:59787 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752615Ab1AZIrm (ORCPT ); Wed, 26 Jan 2011 03:47:42 -0500 Date: Wed, 26 Jan 2011 14:11:03 +0530 From: Srikar Dronamraju To: Peter Zijlstra Cc: Ingo Molnar , Steven Rostedt , Arnaldo Carvalho de Melo , Linus Torvalds , Masami Hiramatsu , Christoph Hellwig , Andi Kleen , Oleg Nesterov , LKML , SystemTap , Jim Keniston , Frederic Weisbecker , Ananth N Mavinakayanahalli , Andrew Morton , "Paul E. McKenney" Subject: Re: [RFC] [PATCH 2.6.37-rc5-tip 4/20] 4: uprobes: Adding and remove a uprobe in a rb tree. Message-ID: <20110126084103.GE19725@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20101216095714.23751.52601.sendpatchset@localhost6.localdomain6> <20101216095803.23751.41491.sendpatchset@localhost6.localdomain6> <1295957742.28776.720.camel@laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1295957742.28776.720.camel@laptop> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra [2011-01-25 13:15:42]: > On Thu, 2010-12-16 at 15:28 +0530, Srikar Dronamraju wrote: > > +/* Should be called lock-less */ > > +static void put_uprobe(struct uprobe *uprobe) > > +{ > > + if (atomic_dec_and_test(&uprobe->ref)) > > + kfree(uprobe); > > +} > > Since this instantly frees the uprobe once ref hits 0, the > atomic_inc_not_zero() in find_uprobe() doesn't really make sense does > it? Okay, I can move the atomic_inc_not_zero() in find_uprobe() to atomic_inc(). Do you see any side-effects of using atomic_inc_not_zero? -- Thanks and Regards Srikar