The patch titled Subject: mm: simplify find_vma_prev() has been removed from the -mm tree. Its filename was mm-simplify-find_vma_prev.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ From: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Subject: mm: simplify find_vma_prev() commit 297c5eee37 ("mm: make the vma list be doubly linked") added the vm_prev member to vm_area_struct. We can simplify find_vma_prev() by using it. Also, this change helps to improve page fault performance because it has stronger locality of reference. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> Cc: Shaohua Li <shaohua.li@xxxxxxxxx> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mmap.c | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff -puN mm/mmap.c~mm-simplify-find_vma_prev mm/mmap.c --- a/mm/mmap.c~mm-simplify-find_vma_prev +++ a/mm/mmap.c @@ -1603,39 +1603,19 @@ struct vm_area_struct *find_vma(struct m EXPORT_SYMBOL(find_vma); -/* Same as find_vma, but also return a pointer to the previous VMA in *pprev. */ +/* + * Same as find_vma, but also return a pointer to the previous VMA in *pprev. + * Note: pprev is set to NULL when return value is NULL. + */ struct vm_area_struct * find_vma_prev(struct mm_struct *mm, unsigned long addr, struct vm_area_struct **pprev) { - struct vm_area_struct *vma = NULL, *prev = NULL; - struct rb_node *rb_node; - if (!mm) - goto out; - - /* Guard against addr being lower than the first VMA */ - vma = mm->mmap; - - /* Go through the RB tree quickly. */ - rb_node = mm->mm_rb.rb_node; - - while (rb_node) { - struct vm_area_struct *vma_tmp; - vma_tmp = rb_entry(rb_node, struct vm_area_struct, vm_rb); - - if (addr < vma_tmp->vm_end) { - rb_node = rb_node->rb_left; - } else { - prev = vma_tmp; - if (!prev->vm_next || (addr < prev->vm_next->vm_end)) - break; - rb_node = rb_node->rb_right; - } - } + struct vm_area_struct *vma; -out: - *pprev = prev; - return prev ? prev->vm_next : vma; + vma = find_vma(mm, addr); + *pprev = vma ? vma->vm_prev : NULL; + return vma; } /* _ Patches currently in -mm which might be from kosaki.motohiro@xxxxxxxxxxxxxx are origin.patch oom-memcg-fix-exclusion-of-memcg-threads-after-they-have-detached-their-mm.patch memcg-cleanup-for_each_node_state.patch page_alloc-break-early-in-check_for_regular_memory.patch page_cgroup-drop-multi-config_memory_hotplug.patch vmscan-trace-add-file-info-to-trace_mm_vmscan_lru_isolate.patch mm-take-pagevecs-off-reclaim-stack.patch mm-fewer-underscores-in-____pagevec_lru_add.patch mm-no-blank-line-after-export_symbol-in-swapc.patch mm-enum-lru_list-lru.patch mm-remove-del_page_from_lru-add-page_off_lru.patch mm-remove-isolate_pages.patch kexec-remove-kmsg_dump_kexec.patch ipc-mqueue-simplify-reading-msgqueue-limit.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html