diff options
author | Zhigang Lu <[email protected]> | 2019-11-30 17:57:06 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2019-12-01 12:59:08 -0800 |
commit | acbfb087e3b19959d6f4b779a9a15bff644b8c9a (patch) | |
tree | b0786d716ffabb9701cb654810f55e1c2fc0f6a3 /tools/perf/scripts/python/stackcollapse.py | |
parent | 188b04a7d93860fd100b2671600b8ad81fb0a842 (diff) |
mm/hugetlb: avoid looping to the same hugepage if !pages and !vmas
When mmapping an existing hugetlbfs file with MAP_POPULATE, we find it
is very time consuming. For example, mmapping a 128GB file takes about
50 milliseconds. Sampling with perfevent shows it spends 99% time in
the same_page loop in follow_hugetlb_page().
samples: 205 of event 'cycles', Event count (approx.): 136686374
- 99.04% test_mmap_huget [kernel.kallsyms] [k] follow_hugetlb_page
follow_hugetlb_page
__get_user_pages
__mlock_vma_pages_range
__mm_populate
vm_mmap_pgoff
sys_mmap_pgoff
sys_mmap
system_call_fastpath
__mmap64
follow_hugetlb_page() is called with pages=NULL and vmas=NULL, so for
each hugepage, we run into the same_page loop for pages_per_huge_page()
times, but doing nothing. With this change, it takes less then 1
millisecond to mmap a 128GB file in hugetlbfs.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Zhigang Lu <[email protected]>
Reviewed-by: Haozhong Zhang <[email protected]>
Reviewed-by: Zongming Zhang <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Acked-by: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions