summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorVlastimil Babka2013-09-11 23:22:35 +0200
committerLinus Torvalds2013-09-12 00:58:01 +0200
commit7a8010cd36273ff5f6fea5201ef9232f30cebbd9 (patch)
tree3805f3d9a8a1f1c1c555ef31bc1bdb51fb51e33e /mm/vmscan.c
parentmm: munlock: remove redundant get_page/put_page pair on the fast path (diff)
downloadkernel-qcow2-linux-7a8010cd36273ff5f6fea5201ef9232f30cebbd9.tar.gz
kernel-qcow2-linux-7a8010cd36273ff5f6fea5201ef9232f30cebbd9.tar.xz
kernel-qcow2-linux-7a8010cd36273ff5f6fea5201ef9232f30cebbd9.zip
mm: munlock: manual pte walk in fast path instead of follow_page_mask()
Currently munlock_vma_pages_range() calls follow_page_mask() to obtain each individual struct page. This entails repeated full page table translations and page table lock taken for each page separately. This patch avoids the costly follow_page_mask() where possible, by iterating over ptes within single pmd under single page table lock. The first pte is obtained by get_locked_pte() for non-THP page acquired by the initial follow_page_mask(). The rest of the on-stack pagevec for munlock is filled up using pte_walk as long as pte_present() and vm_normal_page() are sufficient to obtain the struct page. After this patch, a 14% speedup was measured for munlocking a 56GB large memory area with THP disabled. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Cc: Jörn Engel <joern@logfs.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Michel Lespinasse <walken@google.com> Cc: Hugh Dickins <hughd@google.com> Cc: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
0 files changed, 0 insertions, 0 deletions