Messages in this thread | | | Date | Fri, 1 Jun 2012 22:03:15 +0530 | From | Srikar Dronamraju <> | Subject | Re: [PATCH 1/3] uprobes: install_breakpoint() should fail if is_swbp_insn() == T |
| |
* Oleg Nesterov <oleg@redhat.com> [2012-06-01 17:53:12]:
> On 05/31, Oleg Nesterov wrote: > > > > __find_next_vma_info() checks tmpvi->mm == vma->vm_mm to detect the > > already visited mm/vma. However, afaics this can be false positive? > > Yes, but I guess this is harmless, we can rely on uprobe_mmap. > > > > But. Doesn't this mean we can greatly simplify register_for_each_vma() > and make it O(n) ? > > Unless I missed something, we can simply create the list of > mm/vaddr structures under ->i_mmap_mutex (vma_prio_tree_foreach), then > register_for_each_vma() can process the list and that is all.
If I remember correctly, we cannot allocate the list elements under i_mmap_mutex. We dont know how many list elements to allocate.
This is what Peter had to say : https://lkml.org/lkml/2011/6/27/72
"Because we try to take i_mmap_mutex during reclaim, trying to unmap pages. So suppose we do an allocation while holding i_mmap_mutex, find there's no free memory, try and unmap a page in order to free it, and we're stuck."
> > If another mapping comes after we drop i_mmap_mutex, uprobe_mmap() > should be called and it should install the bp. >
-- Thanks and Regards Srikar
| |