aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/sched/mm.h
diff options
context:
space:
mode:
authorChengming Zhou <zhouchengming@bytedance.com>2024-02-09 04:41:12 +0000
committerAndrew Morton <akpm@linux-foundation.org>2024-02-22 10:24:57 -0800
commitf576a1e80c3a97ea26b436bc060df42cf6d19026 (patch)
treee4bb2be906c29f8f007cebbb4e0ef5a376aaff57 /include/linux/sched/mm.h
parentselftests/mm: log a consistent test name for check_compaction (diff)
downloadwireguard-linux-f576a1e80c3a97ea26b436bc060df42cf6d19026.tar.xz
wireguard-linux-f576a1e80c3a97ea26b436bc060df42cf6d19026.zip
mm/zswap: optimize and cleanup the invalidation of duplicate entry
We may encounter duplicate entry in the zswap_store(): 1. swap slot that freed to per-cpu swap cache, doesn't invalidate the zswap entry, then got reused. This has been fixed. 2. !exclusive load mode, swapin folio will leave its zswap entry on the tree, then swapout again. This has been removed. 3. one folio can be dirtied again after zswap_store(), so need to zswap_store() again. This should be handled correctly. So we must invalidate the old duplicate entry before inserting the new one, which actually doesn't have to be done at the beginning of zswap_store(). The good point is that we don't need to lock the tree twice in the normal store success path. And cleanup the loop as we are here. Note we still need to invalidate the old duplicate entry when store failed or zswap is disabled , otherwise the new data in swapfile could be overwrite by the old data in zswap pool when lru writeback. Link: https://lkml.kernel.org/r/20240209044112.3883835-1-chengming.zhou@linux.dev Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Yosry Ahmed <yosryahmed@google.com> Acked-by: Chris Li <chrisl@kernel.org> Acked-by: Nhat Pham <nphamcs@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/sched/mm.h')
0 files changed, 0 insertions, 0 deletions