From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4FA9131280F; Wed, 28 Jan 2026 15:43:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769615031; cv=none; b=Ce/ZZAbWXXrDEsMgJsi6DcYGOblIA20g36saDmORmGZ2RMBopqVxbwagRYJOGRnqH8S18EoVo4Y7HNYEyhTRl65mh3rHfTaP3FhxrOFrrUGNJL1cCUnC18hwqQ2/HJSxJKs+l7HhZbtrfcTE4sVzMcIgl1jfq8YYw2Q0KgLCgaA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769615031; c=relaxed/simple; bh=ceO20kSzass4p5H+niKRrTD558uGYa3CQlaX3jAmmac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bV0uKxWdFbc88tdsVTeLgPMzgU6MdG/oBzadChiR4Dj6d7DTV3QXzz+jDil4pppjAw7XKs8gTTKj55TGw7gcwZhdvrzgLl3oHMqkwkIXdL2bWHv5mAFXsKR1zOt9ScxTFnu4Iyl7LZiWb9+or9y+zZt2zcN/VPnWNbemLmb6qf0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LSKQxowo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="LSKQxowo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B598C4CEF1; Wed, 28 Jan 2026 15:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1769615030; bh=ceO20kSzass4p5H+niKRrTD558uGYa3CQlaX3jAmmac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LSKQxowouReDYQ9BO4ItgDTWjOVmu/UBemxB0krFH1lXB/E9O+ScJU/MC5pK17zBu hzhinPZ/kXoNwzS2zAbgZ6N7d2XKID1hYb7rQsoWvruFewaoGgqe9qf0qsUvzTkq5h x6SdP4JeFZ0d1JZJbY8V4GfntiV3Vgdu53Z/T4FU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "David Hildenbrand (Red Hat)" , Rik van Riel , Laurence Oberman , Lorenzo Stoakes , Oscar Salvador , Liu Shixin , Harry Yoo , Lance Yang , "Uschakow, Stanislav" , Andrew Morton Subject: [PATCH 6.12 058/169] mm/rmap: fix two comments related to huge_pmd_unshare() Date: Wed, 28 Jan 2026 16:22:21 +0100 Message-ID: <20260128145336.100760224@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260128145334.006287341@linuxfoundation.org> References: <20260128145334.006287341@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Hildenbrand (Red Hat) commit a8682d500f691b6dfaa16ae1502d990aeb86e8be upstream. PMD page table unsharing no longer touches the refcount of a PMD page table. Also, it is not about dropping the refcount of a "PMD page" but the "PMD page table". Let's just simplify by saying that the PMD page table was unmapped, consequently also unmapping the folio that was mapped into this page. This code should be deduplicated in the future. Link: https://lkml.kernel.org/r/20251223214037.580860-4-david@kernel.org Fixes: 59d9094df3d7 ("mm: hugetlb: independent PMD page table shared count") Signed-off-by: David Hildenbrand (Red Hat) Reviewed-by: Rik van Riel Tested-by: Laurence Oberman Reviewed-by: Lorenzo Stoakes Acked-by: Oscar Salvador Cc: Liu Shixin Cc: Harry Yoo Cc: Lance Yang Cc: "Uschakow, Stanislav" Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- mm/rmap.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1753,14 +1753,8 @@ static bool try_to_unmap_one(struct foli flush_tlb_range(vma, range.start, range.end); /* - * The ref count of the PMD page was - * dropped which is part of the way map - * counting is done for shared PMDs. - * Return 'true' here. When there is - * no other sharing, huge_pmd_unshare - * returns false and we will unmap the - * actual page and drop map count - * to zero. + * The PMD table was unmapped, + * consequently unmapping the folio. */ goto walk_done; } @@ -2128,14 +2122,8 @@ static bool try_to_migrate_one(struct fo range.start, range.end); /* - * The ref count of the PMD page was - * dropped which is part of the way map - * counting is done for shared PMDs. - * Return 'true' here. When there is - * no other sharing, huge_pmd_unshare - * returns false and we will unmap the - * actual page and drop map count - * to zero. + * The PMD table was unmapped, + * consequently unmapping the folio. */ page_vma_mapped_walk_done(&pvmw); break;