perf/core: Fix arch_perf_get_page_size()
The (new) page-table walker in arch_perf_get_page_size() is broken in various ways. Specifically while it is used in a lockless manner, it doesn't depend on CONFIG_HAVE_FAST_GUP nor uses the proper _lockless offset methods, nor is careful to only read each entry only once. Also the hugetlb support is broken due to calling pte_page() without first checking pte_special(). Rewrite the whole thing to be a proper lockless page-table walker and employ the new pXX_leaf_size() pgtable functions to determine the pagetable size without looking at the page-frames. Fixes: 51b646b2 ("perf,mm: Handle non-page-table-aligned hugetlbfs") Fixes: 8d97e718 ("perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE") Signed-off-by:Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by:
Kan Liang <kan.liang@linux.intel.com> Link: https://lkml.kernel.org/r/20201126124207.GM3040@hirez.programming.kicks-ass.net
Showing
Please register or sign in to comment