From nobody Wed Dec 17 10:45:58 2025 Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.149]) (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 482B179D0 for ; Fri, 12 Jul 2024 02:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720752310; cv=none; b=XT5+IXpbw6RHanZUbOSJD9yFkLwQPn0G24RSCPCkGVkSt1C35PWGVv74moQCImz+FbNTYg9OT4JrlPqKx67yjtrIPWEOCvzba5FizPOiUCAF7R2QiOKwbV7dmT6t8qhaH8edNzyz14QcrNMfOFkNM9LS9QaRSx1DqhnKJlwFxiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720752310; c=relaxed/simple; bh=nbvpJQzFIg23rNR8yhUFc2jwjZR2DQm8DGNmSgSF76A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fo1P1hvTqMfjUjMGDm1q2iFXkvahELH60ioEXP4280xUJSXHQdX6J+okKrKFvGTH9+pYm78m0U2+Z2hw/R0lsSOdynPXzlXi6LSJf+0k+ILq12fpdhy4RGkUKgLYJsNezG/CBFKPI9ydv8plVX413IrU+UHgv/3C7vLLdtnGIBY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sent.com; spf=pass smtp.mailfrom=sent.com; dkim=pass (2048-bit key) header.d=sent.com header.i=@sent.com header.b=lz8yYnWl; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=F1B8jHJ4; arc=none smtp.client-ip=103.168.172.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sent.com header.i=@sent.com header.b="lz8yYnWl"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="F1B8jHJ4" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 5CDE01388638; Thu, 11 Jul 2024 22:45:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 11 Jul 2024 22:45:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:subject:subject:to:to; s=fm2; t=1720752307; x=1720838707; bh=jNGroiyo4BuTb3hCWpWux7PfCpk0jLOtvpYsdbCWP/I=; b= lz8yYnWlO09wfHb83ln8BKkBoq5gRUQUwFV6dKkRSNHwT4rFIM9zWzLIqahj4zcY nIKYIY0qBuykHnAcw9kWMVsgUcfpGapKaEEYwFcjePBPb9J+vOKMqVWSuhQdCUgi X/ywcj41J/8GmeqbecKCObHP2Gl3Zr1ZqExtA96VyEde9CU/pdggiB24rp7Ynkr3 KmvsfUc7zb0dwxGPPC5RGBYlTmzbvDgrDGjuoYWCIjKEyIi2CsDuZ8gZCHfRMDAy iA7+METH6x27l+qkdLRd79V01z1npc7+W91QR4PbAE2opafwTdtzGiAXOodyqxH/ P+RcVgx5iCn98RjXD2Wk8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1720752307; x= 1720838707; bh=jNGroiyo4BuTb3hCWpWux7PfCpk0jLOtvpYsdbCWP/I=; b=F 1B8jHJ4ViBoTClRPWsQtEFz8ORDTWX/HBWUZXJMc/mK0/CscC9ecK2cnFdnms0Be Di/RSin7dfh9ANGM62MH/uM50t0aqSb1MHPuEYdPLltOQ15RQGlK0fnZVZGRt97l VE31CoxTR5wQr+uQojH/Oy1DWxLiiC80wUV7S7nzO3hbRu1IXbvqTq2JlXFJd5de aGcgLCth+TsO3jtZOGz0cqf/9IFDBzNrZP83iQ5jAddkb2UXrMHU0OurI1IE7twH t/zF5WbD9PIw2WTeQ2QEpLUvG8j901OJkltRg91Lsk1qggqlaE5i2tb4TNhXt3Ru ZojyNMaWjOD7ZZ300CnuQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrfeehgdeigecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfrhgggfestdekredtredttdenucfhrhhomhepkghiucgj rghnuceoiihirdihrghnsehsvghnthdrtghomheqnecuggftrfgrthhtvghrnhepudfgfe elhfekiefgtedvudfghfduffefieefffejvefhlefhhffgkedtfeevhfevnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepiihirdihrghnsehsvg hnthdrtghomh X-ME-Proxy: Feedback-ID: iccd040f4:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Jul 2024 22:45:05 -0400 (EDT) From: Zi Yan To: David Hildenbrand , "Huang, Ying" , linux-mm@kvack.org Cc: Zi Yan , Andrew Morton , Baolin Wang , linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/3] memory tiering: read last_cpupid correctly in do_huge_pmd_numa_page() Date: Thu, 11 Jul 2024 22:44:53 -0400 Message-ID: <20240712024455.163543-2-zi.yan@sent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712024455.163543-1-zi.yan@sent.com> References: <20240712024455.163543-1-zi.yan@sent.com> Reply-To: Zi Yan Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zi Yan last_cpupid is only available when memory tiering is off or the folio is in toptier node. Complete the check to read last_cpupid when it is available. Before the fix, the default last_cpupid will be used even if memory tiering mode is turned off at runtime instead of the actual value. This can prevent task_numa_fault() from getting right numa fault stats, but should not cause any crash. User might see performance changes after the fix. Fixes: 33024536bafd ("memory tiering: hot page selection with hint page fau= lt latency") Signed-off-by: Zi Yan Acked-by: David Hildenbrand Reported-by: ... Reported-by: David Hildenbrand Reviewed-by: "Huang, Ying" Reviewed-by: Baolin Wang --- mm/huge_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index d7c84480f1a4..07d9dde4ca33 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1705,7 +1705,8 @@ vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf) * For memory tiering mode, cpupid of slow memory page is used * to record page access time. So use default value. */ - if (node_is_toptier(nid)) + if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) || + node_is_toptier(nid)) last_cpupid =3D folio_last_cpupid(folio); target_nid =3D numa_migrate_prep(folio, vmf, haddr, nid, &flags); if (target_nid =3D=3D NUMA_NO_NODE) --=20 2.43.0