From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5671D1891A9 for ; Fri, 11 Sep 2026 00:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789085878; cv=none; b=hC9pU9OYsEphXop2XDgrAxr8Eo8mQYn3/TOQRSoRFY+Oaq2azbtiJpgKZMdUzM4gXHPFDjXb9jlVT9KYwiTxVnbukYtvkr/q1DrYRYhSQKNAP4ecCwFkSX8g9U6cp0kCrsMi29YgnzK1wsVbkIW8xTyFdQ5InkYlNXRQDBSaEE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789085878; c=relaxed/simple; bh=5pHfbIctNQecgR8Q0BHp72uANNHcYv+BRO4W6kAZQ9c=; h=Date:To:From:Subject:Message-Id; b=L/5OCvUQGAVPjaAR3MkaJUfjWdPpA+ib53eiLW2/8gcokucYU9UViOTnutQiL6xmhiGG29oe0VtO8nKq22ST1sCArqfSYxkYKLmyMcsITvZhycylJdAjsCr+Qwz00tuBHdNOcesFclB/9h9QGwDT7rZMu+dp9dB3++0MlDlqXN4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=Hz35eL2L; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Hz35eL2L" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D549E1F00893; Fri, 11 Sep 2026 00:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1789085876; bh=xL2v6fOJFAPGzbhVjhwWGBLq3MkN2sKcBNnHaOTDQxM=; h=Date:To:From:Subject; b=Hz35eL2L0RSXzFY2juNaxHFJZeacG9nrwQXbi/5+yfS/EdfQlCE29nj0/p98aYkGV TVjvI79GJfRe1WX/a8loS8DPcvFe9/TpEvaUSm2c+nYo3mpEz5dFZKVvuhNfCGf9Mg IoCJ+QwjnZ5BUMx32ia3KRRm3WbYkulmqSmbwN2U= Date: Thu, 10 Sep 2026 17:17:56 -0700 To: mm-commits@vger.kernel.org,youngjun.park@lge.com,nphamcs@gmail.com,luizcap@redhat.com,kasong@tencent.com,chrisl@kernel.org,baoquan.he@linux.dev,baohua@kernel.org,shikemeng@huaweicloud.com,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-swap-remove-unneeded-swap_extend_table_try_free-in-swap_dup_entries_cluster.patch added to mm-new branch Message-Id: <20260911001756.D549E1F00893@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm, swap: remove unneeded swap_extend_table_try_free() in swap_dup_entries_cluster() has been added to the -mm mm-new branch. Its filename is mm-swap-remove-unneeded-swap_extend_table_try_free-in-swap_dup_entries_cluster.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-swap-remove-unneeded-swap_extend_table_try_free-in-swap_dup_entries_cluster.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next 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 various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Kemeng Shi Subject: mm, swap: remove unneeded swap_extend_table_try_free() in swap_dup_entries_cluster() Date: Mon, 7 Sep 2026 17:13:56 +0800 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 Reviewed-by: Youngjun Park Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Kairui Song Cc: Luiz Capitulino Cc: Nhat Pham Signed-off-by: Andrew Morton --- mm/swapfile.c | 1 - 1 file changed, 1 deletion(-) --- a/mm/swapfile.c~mm-swap-remove-unneeded-swap_extend_table_try_free-in-swap_dup_entries_cluster +++ a/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; } _ Patches currently in -mm which might be from shikemeng@huaweicloud.com are mm-swap-fix-potential-null-dereference-when-trying-a-sleep-table-allocation.patch mm-swap-move-setup_swap_clusters_info-after-swp_solidstate-initialization.patch mm-swap-return-early-from-swap_extend_table_try_free-on-first-non-zero-entry.patch mm-swap-remove-unneeded-swap_extend_table_try_free-in-swap_dup_entries_cluster.patch