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 A72B5303CAA for ; Mon, 26 Jan 2026 13:18:48 +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=1769433528; cv=none; b=An4xzKNXbi7s7TGutMO1hzcJZ/QYwGwRnamQxtvKWlKgaB8LCHUygf5x8D/Q084BeQrw1o9iRo0qwzOdHki6HOm62kQmPCi38wi4D+zMCWlm3DJjU0+ce97QUc8FTWZLVSuLfItzd4Z9qc1haYcxGFJGsrRgs+feUj8a6obwM4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769433528; c=relaxed/simple; bh=l2cRIdVQPBpdOYJMcAcOgryh/sP72BQhrKNrTyIKXJo=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=Ta4znEYZmW+d0UtUmhCEqL1d3Vm/mbD4wRKpXoilaHIE6AhUUaE2fObSHHR4oW5gHZjzEZ9u6eDrtVp9c1N5EbVH+QcVs9BM0ASVbrKea0oiWE3JlRDF9Zg5FzbgoGwwBv58mWZCIXI85abnbdi64qKfpkQMAIcWMyA+yX0+kbM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MwCbWOAD; 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="MwCbWOAD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D4AEC116C6; Mon, 26 Jan 2026 13:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1769433528; bh=l2cRIdVQPBpdOYJMcAcOgryh/sP72BQhrKNrTyIKXJo=; h=Subject:To:Cc:From:Date:From; b=MwCbWOADkDyeMYhfDo/HjOfSkq4cObVL18tmJpMrcbjTq3xdp3exe0xhg7bKXdnd8 fxFeMvHW7APquDF2Xbgs3wcpz4BSYOGFvIioEcHMY5RcS9Q3CBjueyFh0Fkd7DZuqx uT7QZMT+A5h/i0U8mXHcC2AfEPRjhK4PpLxB5CVA= Subject: FAILED: patch "[PATCH] mm/rmap: fix two comments related to huge_pmd_unshare()" failed to apply to 6.1-stable tree To: david@kernel.org,akpm@linux-foundation.org,harry.yoo@oracle.com,lance.yang@linux.dev,liushixin2@huawei.com,loberman@redhat.com,lorenzo.stoakes@oracle.com,osalvador@suse.de,riel@surriel.com,stable@vger.kernel.org,suschako@amazon.de Cc: From: Date: Mon, 26 Jan 2026 14:18:37 +0100 Message-ID: <2026012637-grope-geologic-e069@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x a8682d500f691b6dfaa16ae1502d990aeb86e8be # git commit -s git send-email --to '' --in-reply-to '2026012637-grope-geologic-e069@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From a8682d500f691b6dfaa16ae1502d990aeb86e8be Mon Sep 17 00:00:00 2001 From: "David Hildenbrand (Red Hat)" Date: Tue, 23 Dec 2025 22:40:36 +0100 Subject: [PATCH] mm/rmap: fix two comments related to huge_pmd_unshare() 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 diff --git a/mm/rmap.c b/mm/rmap.c index f955f02d570e..748f48727a16 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -2016,14 +2016,8 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma, 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; } @@ -2416,14 +2410,8 @@ static bool try_to_migrate_one(struct folio *folio, struct vm_area_struct *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. */ page_vma_mapped_walk_done(&pvmw); break;