summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorKemeng Shi <shikemeng@huaweicloud.com>2026-09-07 17:13:56 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-09-13 21:32:39 -0700
commit061fee8e9e3e2b1bd26bb1012a100bf535991727 (patch)
treeb9772e1b4ef89b82c8768fed26d89b3c70d168c7 /mm
parent2ddc8ddd5c3185409f669dee086da1811b7b2ffd (diff)
downloadlinux-next-061fee8e9e3e2b1bd26bb1012a100bf535991727.tar.gz
linux-next-061fee8e9e3e2b1bd26bb1012a100bf535991727.zip
mm, swap: remove unneeded swap_extend_table_try_free() in swap_dup_entries_cluster()
Since commit 0475fde0f68de ("mm, swap: avoid leaving unused extend table after alloc race"), extend table is always allocated when any swap count reach MAX - 1 and is always freed when swap count decrease to MAX - 1 or MAX - 2 with cluster lock held. So the extend table will always be freed properly when decrease swap count in __swap_cluster_put_entry(). So swap_extend_table_try_free() outside of __swap_cluster_put_entry() is unneeded and can be removed. Link: https://lore.kernel.org/20260907091356.53026-5-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Youngjun Park <youngjun.park@lge.com> Cc: Baoquan He <baoquan.he@linux.dev> Cc: Barry Song <baohua@kernel.org> Cc: Chris Li <chrisl@kernel.org> Cc: Kairui Song <kasong@tencent.com> Cc: Luiz Capitulino <luizcap@redhat.com> Cc: Nhat Pham <nphamcs@gmail.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/swapfile.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 7b35ca90776a..2cd0d0ba966c 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1725,7 +1725,6 @@ restart:
failed:
while (ci_off-- > ci_start)
__swap_cluster_put_entry(ci, ci_off);
- swap_extend_table_try_free(ci);
swap_cluster_unlock(ci);
return err;
}