The patch titled Subject: mm: zswap: use zswap_invalidate_entry() for duplicates has been added to the -mm mm-unstable branch. Its filename is mm-zswap-use-zswap_invalidate_entry-for-duplicates.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-zswap-use-zswap_invalidate_entry-for-duplicates.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Johannes Weiner <hannes@xxxxxxxxxxx> Subject: mm: zswap: use zswap_invalidate_entry() for duplicates Date: Thu, 27 Jul 2023 12:22:23 -0400 Patch series "mm: zswap: three cleanups". Three small cleanups to zswap, the first one suggested by Yosry during the frontswap removal. This patch (of 3): Minor cleanup. Instead of open-coding the tree deletion and the put, use the zswap_invalidate_entry() convenience helper. Link: https://lkml.kernel.org/r/20230727162343.1415598-1-hannes@xxxxxxxxxxx Link: https://lkml.kernel.org/r/20230727162343.1415598-2-hannes@xxxxxxxxxxx Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx> Suggested-by: Yosry Ahmed <yosryahmed@xxxxxxxxxx> Cc: Domenico Cerasuolo <cerasuolodomenico@xxxxxxxxx> Cc: Nhat Pham <nphamcs@xxxxxxxxx> Cc: Barry Song <song.bao.hua@xxxxxxxxxxxxx> Cc: Seth Jennings <sjenning@xxxxxxxxxx> Cc: Vitaly Wool <vitaly.wool@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/zswap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/mm/zswap.c~mm-zswap-use-zswap_invalidate_entry-for-duplicates +++ a/mm/zswap.c @@ -1370,9 +1370,7 @@ insert_entry: spin_lock(&tree->lock); while (zswap_rb_insert(&tree->rbroot, entry, &dupentry) == -EEXIST) { zswap_duplicate_entry++; - /* remove from rbtree */ - zswap_rb_erase(&tree->rbroot, dupentry); - zswap_entry_put(tree, dupentry); + zswap_invalidate_entry(tree, dupentry); } if (entry->length) { spin_lock(&entry->pool->lru_lock); _ Patches currently in -mm which might be from hannes@xxxxxxxxxxx are mm-kill-frontswap.patch mm-kill-frontswap-fix.patch mm-zswap-use-zswap_invalidate_entry-for-duplicates.patch mm-zswap-tighten-up-entry-invalidation.patch mm-zswap-kill-zswap_get_swap_cache_page.patch