[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120915144101.GA19898@redhat.com>
Date: Sat, 15 Sep 2012 16:41:01 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@...e.hu>, Peter Zijlstra <peterz@...radead.org>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Anton Arapov <anton@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] uprobes: teach find_active_uprobe() to clear
MMF_HAS_UPROBES
On 09/14, Srikar Dronamraju wrote:
>
> * Oleg Nesterov <oleg@...hat.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@...ux.vnet.ibm.com>
Thanks,
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists