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 9CDAA23F27B for ; Sat, 13 Sep 2025 19:03:41 +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=1757790221; cv=none; b=onVJaYOLIBjO9QNlyko5Iz1i5XKJlatuylkJyODMGGjQSJvWofOclhN+owysN3iF68tjTc/5Yx9M+teP/6lizCd1cPWj+IRaTd+rl4uZ9MKtrlABN9oTj/HbhofFTScu4lWsZJKkMoKCI0A23BHxyQN+jBtNr7kxoHAu6d3Mmt0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757790221; c=relaxed/simple; bh=T3dkmWORQe90MU3cp/3+staKul4tGEFPS6C44b6kaKk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E4cmpl/tU9ZFElMEbFjf8N3vwPaczKIK8gsJ57yLwHa8b6rNXzJs9NCVa6mWeB8VFJwUK8VT/33XIpABUOkicssYz7bVVYU8l4umixgmCbfzd4Vb78dt0i0pgLCDHqC47SvNKAkDMrSg5CLo4XERDskJkTXgqKo3N0eI9gw0pWw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bczikdWV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bczikdWV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BF4BC4CEF9; Sat, 13 Sep 2025 19:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757790221; bh=T3dkmWORQe90MU3cp/3+staKul4tGEFPS6C44b6kaKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bczikdWVr9Arr+C/shxcsUtzCIzXim9gifakaKFDN9+elRJTKSwAQbEyNmR9qB9iV 50cSkKJa+SyUePqXKkgr6Ckt1qCnoE89UtNdrfWQcOK8rOMQTsNPrr5OmDEInNU/OP e/Igs/vu1Z0lvgGsPAPWl+2W+dHNMnLF+2hirbMOkaGXlDUvA3qEn7752LAj+VTV4g Iq46XZXX6glrMM7oQi2vYxTjyJNxVMqDbSD0pu3Bn1aEceJy6WoQVa0VL95UxiXxaT 8UT6a23rM90hU5bupIs1cc6TOVugJUvERQr/gVlwrYlMBaT1dgTl99cSrX2LfNPOs9 JlrU+Kc58uY3w== From: Sasha Levin To: stable@vger.kernel.org Cc: Wei Yang , Dev Jain , Zi Yan , David Hildenbrand , Lorenzo Stoakes , Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Barry Song , Andrew Morton , Sasha Levin Subject: [PATCH 6.1.y 2/2] mm/khugepaged: fix the address passed to notifier on testing young Date: Sat, 13 Sep 2025 15:03:37 -0400 Message-ID: <20250913190337.1520681-2-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250913190337.1520681-1-sashal@kernel.org> References: <2025091344-pronounce-zoning-2e65@gregkh> <20250913190337.1520681-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Wei Yang [ Upstream commit 394bfac1c7f7b701c2c93834c5761b9c9ceeebcf ] Commit 8ee53820edfd ("thp: mmu_notifier_test_young") introduced mmu_notifier_test_young(), but we are passing the wrong address. In xxx_scan_pmd(), the actual iteration address is "_address" not "address". We seem to misuse the variable on the very beginning. Change it to the right one. [akpm@linux-foundation.org fix whitespace, per everyone] Link: https://lkml.kernel.org/r/20250822063318.11644-1-richard.weiyang@gmail.com Fixes: 8ee53820edfd ("thp: mmu_notifier_test_young") Signed-off-by: Wei Yang Reviewed-by: Dev Jain Reviewed-by: Zi Yan Acked-by: David Hildenbrand Reviewed-by: Lorenzo Stoakes Cc: Baolin Wang Cc: Liam R. Howlett Cc: Nico Pache Cc: Ryan Roberts Cc: Barry Song Cc: Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- mm/khugepaged.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 0c8e87ded1d4d..ded9a00b20b58 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1276,8 +1276,8 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm, */ if (cc->is_khugepaged && (pte_young(pteval) || folio_test_young(folio) || - folio_test_referenced(folio) || mmu_notifier_test_young(vma->vm_mm, - address))) + folio_test_referenced(folio) || + mmu_notifier_test_young(vma->vm_mm, _address))) referenced++; } if (!writable) { -- 2.51.0