aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorKirill A. Shutemov <[email protected]>2018-01-19 15:49:24 +0300
committerLinus Torvalds <[email protected]>2018-01-21 17:44:47 -0800
commit0d665e7b109d512b7cae3ccef6e8654714887844 (patch)
treee6ebae5cd32b4f9008d06592a5301937c0be5875 /tools/perf/scripts/python/stackcollapse.py
parent0c5b9b5d9adbad4b60491f9ba0d2af38904bb4b9 (diff)
mm, page_vma_mapped: Drop faulty pointer arithmetics in check_pte()
Tetsuo reported random crashes under memory pressure on 32-bit x86 system and tracked down to change that introduced page_vma_mapped_walk(). The root cause of the issue is the faulty pointer math in check_pte(). As ->pte may point to an arbitrary page we have to check that they are belong to the section before doing math. Otherwise it may lead to weird results. It wasn't noticed until now as mem_map[] is virtually contiguous on flatmem or vmemmap sparsemem. Pointer arithmetic just works against all 'struct page' pointers. But with classic sparsemem, it doesn't because each section memap is allocated separately and so consecutive pfns crossing two sections might have struct pages at completely unrelated addresses. Let's restructure code a bit and replace pointer arithmetic with operations on pfns. Signed-off-by: Kirill A. Shutemov <[email protected]> Reported-and-tested-by: Tetsuo Handa <[email protected]> Acked-by: Michal Hocko <[email protected]> Fixes: ace71a19cec5 ("mm: introduce page_vma_mapped_walk()") Cc: [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