From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail138.messagelabs.com (mail138.messagelabs.com [216.82.249.35]) by kanga.kvack.org (Postfix) with ESMTP id E563B9000BD for ; Wed, 21 Sep 2011 00:17:43 -0400 (EDT) Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e37.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p8L4EHWG026868 for ; Tue, 20 Sep 2011 22:14:17 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8L4HYof141866 for ; Tue, 20 Sep 2011 22:17:34 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8L4HWdE014328 for ; Tue, 20 Sep 2011 22:17:34 -0600 Date: Wed, 21 Sep 2011 09:33:44 +0530 From: Srikar Dronamraju Subject: Re: [PATCH v5 3.1.0-rc4-tip 4/26] uprobes: Define hooks for mmap/munmap. Message-ID: <20110921040344.GD6568@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20110920115938.25326.93059.sendpatchset@srdronam.in.ibm.com> <20110920120040.25326.63549.sendpatchset@srdronam.in.ibm.com> <20110920170310.GB27959@stefanha-thinkpad.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20110920170310.GB27959@stefanha-thinkpad.localdomain> Sender: owner-linux-mm@kvack.org List-ID: To: Stefan Hajnoczi Cc: Peter Zijlstra , Steven Rostedt , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Ananth N Mavinakayanahalli , Hugh Dickins , Christoph Hellwig , Jonathan Corbet , Thomas Gleixner , Masami Hiramatsu , Oleg Nesterov , Andrew Morton , Jim Keniston , Roland McGrath , Andi Kleen , LKML * Stefan Hajnoczi [2011-09-20 18:03:10]: > On Tue, Sep 20, 2011 at 05:30:40PM +0530, Srikar Dronamraju wrote: > > +static void build_probe_list(struct inode *inode, struct list_head *head) > > +{ > > + struct uprobe *uprobe; > > + struct rb_node *n; > > + unsigned long flags; > > + > > + n = uprobes_tree.rb_node; > > + spin_lock_irqsave(&uprobes_treelock, flags); > > Not sure whether grabbing root.rb_node outside the spinlock is safe? If > the tree is rotated on another CPU you could catch and out-of-date node? Agree that its better to access the node in the spinlock. Shall correct this. > > +static void dec_mm_uprobes_count(struct vm_area_struct *vma, > > + struct inode *inode) > > +{ > > + struct uprobe *uprobe; > > + struct rb_node *n; > > + unsigned long flags; > > + > > + n = uprobes_tree.rb_node; > > + spin_lock_irqsave(&uprobes_treelock, flags); > > Same here. Okay. -- Thanks and Regards Srikar -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org