summaryrefslogtreecommitdiff
path: root/tools/perf/tests/shell/test_stackcollapse_python.sh
diff options
context:
space:
mode:
authorSJ Park <sj@kernel.org>2026-09-07 10:03:56 -0700
committerAndrew Morton <akpm@linux-foundation.org>2026-09-18 08:20:14 -0700
commit39c0ceedd54557bdc1542de08d22b2ed33e534e4 (patch)
tree4bc081e3c436db30171e3ddb4092cba0cc158ab2 /tools/perf/tests/shell/test_stackcollapse_python.sh
parent90179da203ba8b708c84a12a07cd44be0f346334 (diff)
downloadlinux-next-39c0ceedd54557bdc1542de08d22b2ed33e534e4.tar.gz
linux-next-39c0ceedd54557bdc1542de08d22b2ed33e534e4.zip
mm/damon/vaddr: avoid hw-driven pte updates during damon_hugetlb_mkold()
damon_hugetlb_mkold() reads the page table entry into a local variable, unsets the accessed bit in the variable, and updates the page table entry with the updated variable value. If hardware updates the same page table entry in parallel, the hw updates could be lost. For example, hardware-updated dirty bits might be lost. Avoid the parallel updates by clearing the page table entry when reading it together, using huge_ptep_get_and_clear(). If a parallel write to the memory is made after the clearing, the hw will see the page table entry is cleared, trigger page fault and wait until it is handled. The page fault handling will wait for damon_hugetlb_mkold() due to the page table lock. Because hugetlbfs is an in-memory file system and hugetlb pages cannot be reclaimed, no critical issue is expected to my best knowledge. But definitely this is a nasty bug that should be fixed sooner rather than later. The issue was discovered [1] by Sashiko. Link: https://lore.kernel.org/20260907170358.100168-1-sj@kernel.org Link: https://lore.kernel.org/20260830160545.98969-1-sj@kernel.org [1] Fixes: 49f4203aae06 ("mm/damon: add access checking for hugetlb pages") Signed-off-by: SJ Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: <stable@vger.kernel.org> # 5.17.x
Diffstat (limited to 'tools/perf/tests/shell/test_stackcollapse_python.sh')
0 files changed, 0 insertions, 0 deletions