summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/task-analyzer.py
diff options
context:
space:
mode:
authorKairui Song <kasong@tencent.com>2025-12-20 03:43:38 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-01-31 14:22:55 -0800
commitf7ad377a9222a3e873cd20fd6fccf1a6f7f1347e (patch)
tree443167ae1362b4468058701d89d63325e8ecde4a /tools/perf/scripts/python/task-analyzer.py
parentbc617c990eae4259cd5014d596477cbe0d596417 (diff)
downloadlinux-f7ad377a9222a3e873cd20fd6fccf1a6f7f1347e.tar.gz
linux-f7ad377a9222a3e873cd20fd6fccf1a6f7f1347e.zip
mm, swap: swap entry of a bad slot should not be considered as swapped out
When checking if a swap entry is swapped out, we simply check if the bitwise result of the count value is larger than 0. But SWAP_MAP_BAD will also be considered as a swao count value larger than 0. SWAP_MAP_BAD being considered as a count value larger than 0 is useful for the swap allocator: they will be seen as a used slot, so the allocator will skip them. But for the swapped out check, this isn't correct. There is currently no observable issue. The swapped out check is only useful for readahead and folio swapped-out status check. For readahead, the swap cache layer will abort upon checking and updating the swap map. For the folio swapped out status check, the swap allocator will never allocate an entry of bad slots to folio, so that part is fine too. The worst that could happen now is redundant allocation/freeing of folios and waste CPU time. This also makes it easier to get rid of swap map checking and update during folio insertion in the swap cache layer. Link: https://lkml.kernel.org/r/20251220-swap-table-p2-v5-9-8862a265a033@tencent.com Signed-off-by: Kairui Song <kasong@tencent.com> Reviewed-by: Baoquan He <bhe@redhat.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Barry Song <baohua@kernel.org> Cc: Chris Li <chrisl@kernel.org> Cc: Nhat Pham <nphamcs@gmail.com> Cc: Rafael J. Wysocki (Intel) <rafael@kernel.org> Cc: Yosry Ahmed <yosry.ahmed@linux.dev> Cc: Deepanshu Kartikey <kartikey406@gmail.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kairui Song <ryncsn@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions