]> git.baikalelectronics.ru Git - kernel.git/commit
vm: avoid using find_vma_prev() unnecessarily
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Mar 2012 02:23:36 +0000 (18:23 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Mar 2012 02:23:36 +0000 (18:23 -0800)
commit20c96b52d1629ca51d737e8d156e5a7703fe17fe
treebabf61a0287b0f09f80580847274877831ed6869
parenta8857900fefb321fb9342c94dce8dddb3a41aaba
vm: avoid using find_vma_prev() unnecessarily

Several users of "find_vma_prev()" were not in fact interested in the
previous vma if there was no primary vma to be found either.  And in
those cases, we're much better off just using the regular "find_vma()",
and then "prev" can be looked up by just checking vma->vm_prev.

The find_vma_prev() semantics are fairly subtle (see Mikulas' recent
commit 3d7853c9f4ca: "mm: fix find_vma_prev"), and the whole "return
prev by reference" means that it generates worse code too.

Thus this "let's avoid using this inconvenient and clearly too subtle
interface when we don't really have to" patch.

Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/mm/hugetlbpage.c
mm/mempolicy.c
mm/mlock.c
mm/mprotect.c