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 07E1A18859B; Wed, 4 Feb 2026 15:15:28 +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=1770218129; cv=none; b=CK1jI2rLATxxtFuu5NJWFkyXWL33qvpbo/jRFKBNwi5rOh0/225Oe7lMGsMWnYKT1hsSIu4IMRalhQU7SajBbMrJ/O8I9guD81G3nn4UX7rnJv2pZLR+qghBAG3Q9I8D9CRb/YWMoxzvE5/CaBadHCv/4+lop1IXOOHowodR03w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770218129; c=relaxed/simple; bh=tELssnmH1RSFFzhmjHtDzF14i5RMo316MHyXUONy2J8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FI1VRfmqH3EC5yD8uop5p2QriM2KaQ8UvBMXNOUdnNkZBQol3CrDGwGNZqjFpscI6N789n5mg4NdjEnqxif/L/ON0jq6pGCOsq1Aq5qqXMp1alRFRTbCBCR2rljkMf8Zt4xAGgRJb1hUf9iMRPTFmQjbpUVbi79k0inMA/Z7+O0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kzqf686C; 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="kzqf686C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4F7CC4CEF7; Wed, 4 Feb 2026 15:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770218128; bh=tELssnmH1RSFFzhmjHtDzF14i5RMo316MHyXUONy2J8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kzqf686C1o2GrwSQwUTHVmL41o9dVMCg0+PrHDSbm+tcnh3Nc7pURDs4I9yjUlJU1 J1evOtlfD+7vfWLYdOPUZ+mbLgKJp3tjzI0iKbohWAMUW4eRUm/Eh3TGuXc6APDT8R Bg8YqeWHjc5C7YNoopPqGkIgdZu004xjHw+cjgpg= 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 , Sasha Levin Subject: [PATCH 6.1 220/280] mm/rmap: fix two comments related to huge_pmd_unshare() Date: Wed, 4 Feb 2026 15:39:54 +0100 Message-ID: <20260204143917.522589953@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260204143909.614719725@linuxfoundation.org> References: <20260204143909.614719725@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: "David Hildenbrand (Red Hat)" [ Upstream commit a8682d500f691b6dfaa16ae1502d990aeb86e8be ] 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: Sasha Levin 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 @@ -1574,14 +1574,8 @@ static bool try_to_unmap_one(struct foli mmu_notifier_invalidate_range(mm, 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; @@ -1965,14 +1959,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;