Messages in this thread | | | Date | Sat, 15 Sep 2012 16:41:01 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH 3/3] uprobes: teach find_active_uprobe() to clear MMF_HAS_UPROBES |
| |
On 09/14, Srikar Dronamraju wrote: > > * Oleg Nesterov <oleg@redhat.com> [2012-08-19 18:40:42]: > > > Note the "not strictly accurate" comment in mmf_recalc_uprobes(). > > We can fix this, we only need to teach vma_has_uprobes() to return > > a bit more more info, but I am not sure this worth the trouble. > ... > > + /* > > + * This is not strictly accurate, we can race with > > + * uprobe_unregister() and see the already removed > > + * uprobe if delete_uprobe() was not yet called. > > + */ > > + if (vma_has_uprobes(vma, vma->vm_start, vma->vm_end)) > > Should we set the MMF_RECALC_UPROBES here?
Assuming uprobe was removed - yes.
> Its harmless but my thought was if we indeed saw a uprobe that was > already deleted, then the next time we hit a non uprobe breakpoint in > the same process context, we will not come here because > MMF_RECALC_UPROBES is cleared.
Yes, this is what the comment/changelog tries to document.
vma_has_uprobes() needs to check uprobe->consumers under uprobes_treelock and return no|yes|maybe. Or it can do rb_prev/rb_entry until it finds the live uprobe. We can do this later to improve this logic. And we can do other improvements, say, fork() can be much more accurate but with more complications.
> Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Thanks,
Oleg.
| |