lkml.org 
[lkml]   [2011]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 3.1.0-rc4-tip 4/26] uprobes: Define hooks for mmap/munmap.
* Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> [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


\
 
 \ /
  Last update: 2011-09-21 06:19    [W:0.346 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site