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 303B61E3DFE for ; Sat, 13 Sep 2025 18:59:16 +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=1757789957; cv=none; b=OKcEO2Wlfwi1emsNRH9cF93/ul22MONNDdtb9hXqBVfuAmsvhb7ztMzgfmOUb8NV/T94VW78Wo6UvP/WxPrQK8346aRc71pvVC576N6x3CXsWDUGfWEVN5EKzoOI+qaDopQCLH4Wx4kHdVFZ8WineLHnzd8GTvwVbzOHwwyfsjI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757789957; c=relaxed/simple; bh=sS7MNMvK0mg+gjhOUID0DIbd7jYgAsNpoHVHa3qmpdQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ucZcGzJk9qveIW3kiWtErbPtjfM0EK2MrGSipBsqfTL4IU537mrvBzTxyNRimL8WeCCLEuFMASYk8XdFwcbb2ocXOP04Uxb2PjQXXz19DT9SdDbCbx+/AKSbtj/rZibGauWF5Q9mCc253cAD47NULPx/42S9r+HDxUhaEmGV7Ik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XEF+69Ow; 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="XEF+69Ow" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49120C4CEF5; Sat, 13 Sep 2025 18:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757789956; bh=sS7MNMvK0mg+gjhOUID0DIbd7jYgAsNpoHVHa3qmpdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XEF+69OwGObSWApcFol3W+Myj4BZbO6IWn7PPabc0K1ODsbKpmuFxPuUs5LoNFzyn Sd1Tgckdr/R11oPl6GjvP7p8V1RDZAlao9iMeVzWwrAX+AaZATkBLeGqtjvgVnlSjK H9A1o3cEsZ7HKOg9YCzVazUH7aqK4n8AWX/UOJmW+I8gbsSLU1JSCV2oUwPm3qF2GS MSMrKUBzLsPxDKw0sJCmEwjiQGnq+rcLqzslpeC+WI5VUTwAJ0ckqINY3yftMeoJcL H8/hh3iITwlUCWcZZBtzvoQgYOYeYxtjDsVe1SBBAoKZXurS8JpbTN06t2tawoVnDw PeWU89xpguT4w== 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.6.y 2/2] mm/khugepaged: fix the address passed to notifier on testing young Date: Sat, 13 Sep 2025 14:59:12 -0400 Message-ID: <20250913185912.1514325-2-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250913185912.1514325-1-sashal@kernel.org> References: <2025091344-purist-tattle-13ba@gregkh> <20250913185912.1514325-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 63e268c61e827..16d29ee602c70 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1374,8 +1374,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