Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758159Ab1COQPy (ORCPT ); Tue, 15 Mar 2011 12:15:54 -0400 Received: from mout.perfora.net ([74.208.4.195]:49443 "EHLO mout.perfora.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758122Ab1COQPx (ORCPT ); Tue, 15 Mar 2011 12:15:53 -0400 Date: Tue, 15 Mar 2011 12:15:30 -0400 From: Stephen Wilson To: Steven Rostedt Cc: Srikar Dronamraju , Peter Zijlstra , Ingo Molnar , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Ananth N Mavinakayanahalli , Christoph Hellwig , Andi Kleen , Masami Hiramatsu , Oleg Nesterov , LKML , Jim Keniston , Roland McGrath , SystemTap , Andrew Morton , "Paul E. McKenney" Subject: Re: [PATCH v2 2.6.38-rc8-tip 7/20] 7: uprobes: store/restore original instruction. Message-ID: <20110315161530.GA23862@fibrous.localdomain> References: <20110314133403.27435.7901.sendpatchset@localhost6.localdomain6> <20110314133522.27435.45121.sendpatchset@localhost6.localdomain6> <20110314180914.GA18855@fibrous.localdomain> <20110315092247.GW24254@linux.vnet.ibm.com> <1300196879.9910.271.camel@gandalf.stny.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1300196879.9910.271.camel@gandalf.stny.rr.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-Provags-ID: V02:K0:Kcg2Ogwc2AB4qoXN9gnBlWgwJT0Azl2elvGXsNnYCPn 7qEbflrS08Kh8zvGNo7+F9Y4Pr7NI0xdQdlAUboM7/KGRtKVa6 p6tCNgSK7+lQrUOMzhvjS/HpzPNh5dwfkjhlRwd/4J8ttjGxyY vrPDQc0X5j2Ep3482KTAAI82+9pt+LDfC09gfKEykkZcGGtTuD EnT2Yur279PuSDNlVHt9A1hyqOX6CNb3Icyxce90Ls= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 802 Lines: 36 On Tue, Mar 15, 2011 at 09:47:59AM -0400, Steven Rostedt wrote: > > rcu_read_lock() > > if (mm->owner) { > > get_task_struct(mm->owner) > > tsk = mm->owner; > > } > > rcu_read_unlock() > > if (!tsk) > > return ret; > > > > Agree? > > Or: > > rcu_read_lock(); > tsk = mm->owner; > if (tsk) > get_task_struct(tsk); > rcu_read_unlock(); > if (!tsk) > return ret; > > Probably looks cleaner. Yes, plus we should do "tsk = rcu_dereference(mm->owner);" and wrap the whole thing in a static uprobes_get_mm_owner() or similar. -- steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/