Re: [tip:perf/uprobes] uprobes, mm, x86: Add the ability to installand remove uprobes breakpoints
From: Linus Torvalds
Date: Mon May 21 2012 - 18:00:49 EST
On Mon, May 21, 2012 at 2:37 PM, Andrew Morton
<akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> hm, we seem to have conflicting commits between mainline and linux-next.
> During the merge window. Again. Nobody knows why this happens.
I didn't have my trivial cleanup branches in linux-next, I'm afraid.
Usually my pending cleanups are just small patches that I carry along
without even committing them, this time around I had slightly more
than that.
>
> static void unmap_single_vma(struct mmu_gather *tlb,
> struct vm_area_struct *vma, unsigned long start_addr,
> unsigned long end_addr,
> struct zap_details *details)
> {
> unsigned long start = max(vma->vm_start, start_addr);
> unsigned long end;
>
> if (start >= vma->vm_end)
> return;
> end = min(vma->vm_end, end_addr);
> if (end <= vma->vm_start)
> return;
>
> <<<<<<< HEAD
> =======
> if (vma->vm_file)
> uprobe_munmap(vma, start, end);
>
> if (vma->vm_flags & VM_ACCOUNT)
> *nr_accounted += (end - start) >> PAGE_SHIFT;
>
>>>>>>>> linux-next/akpm-base
Just remove the VM_ACCOUNT and *nr_accounted lines - they're done in
the caller now. They always should have been, I'm not sure why it was
in the "walk the page tables" path, which has nothing to do with it.
That said, I think that's true of uprobes too. Why the f*ck would
uprobes do it's "munmap" operation when we walk the page tables? This
function was called by more than just the actual unmapping, it was
called by stuff that wants to zap the pages but leave the mapping
around.
So that uprobe_munmap() could probably also be better moved into the
caller - where we actually remove the vma. Maybe.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/