From patchwork Thu Jan 9 06:46:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donet Tom X-Patchwork-Id: 13932103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3877AE77197 for ; Thu, 9 Jan 2025 06:47:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D5866B0083; Thu, 9 Jan 2025 01:47:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9859E6B0085; Thu, 9 Jan 2025 01:47:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84CD76B0088; Thu, 9 Jan 2025 01:47:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 27C546B0083 for ; Thu, 9 Jan 2025 01:47:15 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 94B1712176E for ; Thu, 9 Jan 2025 06:47:14 +0000 (UTC) X-FDA: 82986981588.12.7F914C4 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf24.hostedemail.com (Postfix) with ESMTP id 6B74218000A for ; Thu, 9 Jan 2025 06:47:12 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=kt83pvFH; spf=pass (imf24.hostedemail.com: domain of donettom@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=donettom@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736405232; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=0ulnmjbVmIjZxainl/R+0XALbf2M/HuKAn1o/+jKMB8=; b=4UyaMk23aDEsK02gijf7nXwYystaVGTUctAW6Ag1UOgXrIWmK3964Wt+UUBJ35mNsbs88g BYrlFbhCVP02fTfJFNplqgL3d3+5xjluoCyAxAHPoixUW3jiGc8lRGEGi3NLkYEQylIFY4 Hcdx9F5/Mtl6DwS6NzkJKTKIJBzlSPA= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=kt83pvFH; spf=pass (imf24.hostedemail.com: domain of donettom@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=donettom@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736405232; a=rsa-sha256; cv=none; b=0LOaftZt7XRF3gAtNA8MQypP7psNnXBtpDhV2QZChViqowQHmstGGuXg7YfCzI60HsuAZM z/qbLR4QbzzJjNnf0XiZsltOK86gOivkJ+zycUSgyBSugN/RjilPxdFEJUoa84rsbetsl+ 5d7Gu2EN9PqwByU4lJju2tk/0+pFou0= Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5090ejvQ001175; Thu, 9 Jan 2025 06:46:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=pp1; bh=0ulnmjbVmIjZxainl/R+0XALbf2M/HuKAn1o/+jKM B8=; b=kt83pvFHp/NkkPfM6+9G1OTLXLJczo6KCVIKLxlJbhVKu/yZKxtOcOPXl nL/1uMVTQBNOBSb2z0teLMyuW9+wFbx4D+8iUDLoXYyEyQRzKxGNB9lbhuWkzxQi Oi4lym+rp8s/31h0NHp0umz7D6sCntkd8kWw2YP5x8PQ7g1c1u/qorAuLmghyY18 sNY8HI1RORqxXVFynKedD380ZPLJFZKh3acz/Wn/DlIGoTjadxhn1VIBxNNOJV3c /pqPLMlJPuVuGCHRCA1J+72AABT/TGijIAzIB+zVevylxAmnvTy9ohAnXzLP+Vf4 U9uHZYvqyKmh2bM/QsryuOQdt7PoQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 441tu5kmte-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jan 2025 06:46:38 +0000 (GMT) Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 5096kSQK029405; Thu, 9 Jan 2025 06:46:38 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 441tu5kmtc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jan 2025 06:46:38 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 50950HAE016144; Thu, 9 Jan 2025 06:46:37 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 43ygtm3rsq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jan 2025 06:46:37 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5096kZYb57606542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Jan 2025 06:46:35 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68B5320040; Thu, 9 Jan 2025 06:46:35 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6BAB720043; Thu, 9 Jan 2025 06:46:33 +0000 (GMT) Received: from ltczz402-lp1.aus.stglabs.ibm.com (unknown [9.40.194.31]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 9 Jan 2025 06:46:33 +0000 (GMT) From: Donet Tom To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Ritesh Harjani , Baolin Wang , "Aneesh Kumar K . V" , Matthew Wilcox , Zi Yan , David Hildenbrand , Muchun Song Subject: [PATCH] mm/memory.c: Add return NUMA_NO_NODE in numa_migrate_check() when folio_nid() and numa_node_id() are the same. Date: Thu, 9 Jan 2025 00:46:32 -0600 Message-ID: <20250109064632.898260-1-donettom@linux.ibm.com> X-Mailer: git-send-email 2.43.5 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ZY3wOouqS6-o0W4onxMXsU6IGZZ2AJf9 X-Proofpoint-ORIG-GUID: gEmloJ78eu4Llza-tXNJ1lCDJ3aG2ENn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 mlxlogscore=834 adultscore=0 bulkscore=0 impostorscore=0 clxscore=1015 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501090051 X-Rspamd-Queue-Id: 6B74218000A X-Stat-Signature: f3p1jgn1hni9aieg1qt7ue3mo5ez5uih X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736405232-627702 X-HE-Meta: U2FsdGVkX1/YPUJOSztOA+oFhf83PZRat1hXbfrL/ZqOgT7ERc+Z0krXqUu+kLNQ1HS+AgRHBgGuI8YSwIJl90V1HAleLZVQPEBRLz6kKeQk6WlcJRvQpQPg0rsVDPv8yQdJnJ0jAlh+kuR9hiYDONpx6Q7ERg/Q+iM5K+VFaszueL/nfhrC7FqLrdtcNIxXrgCdrDDxzEcCkPqalu0ZAUNXqcEeZVnYvfTHWvM+KSYuddwvFaDIFI8dMGSmsfGSzx6KZ1s9fduJHWLVJ1482ztecGE8mtousQ6K0dTxIb1koUrLRo5iosqlGl68mHV/oqRkXif42UnsABbjmlJLDY3QGxBxwzrpDcvnNHv89dUF6N0Fwupwmx8741KeZ3dbpRxT0qL8AZ5qlVd9notsMNeI9O4028+CSt3VYHdVeRuKfFi+HJfNsy9X4uBgrlTG8kRGeKkSWkrh1RADS0wDT02o0kRq/FAC9IGj6Af7XGo845L4b9S1ZB7SOPNBXTQCPLblM5JsIR1C18xeyP2KfL2YtLfO3+OYJAvAT7Ej1UY6KLK54rM2OARIC2IeB1FjqjtQOzq7OyGQZeeW1sWejOHNGwCcAFt1CSLjP/byOWQFYXR4GddaFQOQ3gByiuYSQDfZmM5t4XGtbRNeaYUXV22X0YK1tfL1t7acZQ9YhYNY8L5WTXu3Gy7GAn/flZs0xQvvi4ok+6TqtyhhOBk+RxzIR//Drt5oD2tBUgUF//sX07G/KR+T5haPYKsJiggl9BgiOxJGnCEOtZjSYVj5dzIaaXKb7zVIt/No+A9p43sztBZ5sYpBUL/FfAf+Kf2pJCQH08mmoWZCExzAH+lHQ5/A29qVQw9+FmiFUrQo8HhPf6O0NQijrVJIEfVIIIoPidQ43oSLT7oxXe+dOSeLZlI8lr0gmaOZQRVJqx+ZR+sXbvB1br/MOKVRdWoT54xhde/Nw8v/g+o8veNrd6D kBGkmfga zSMInml+1HUw99aGasmzBEe3Ync3Qu62wYV1CrklKSv0Cmq7qQmFm+ly8b++XfSJPSojMEJG0ngMxE5Tdjk+o6nwPHXEVNQ7/0W2AzXt8Dg0dNCpnJPuOw6OBnOfls+D5VGYqOCvW7E4Yaur+yVVGefz2Ni8hyYv+1FaZ2teoTp8D7qIlYAHs72AO4W2dt6yoenmhhUY9Xn3W2EsS3h+l9rOpKtKGEy0NVerCK9lSf1t1UtgCoBIQpR2Z4mwsSN4c80u4BchizE/1W6HS0IPbYTdzj76XZSQQEGbciBrzdHAWggKV4KsW5M5oMl59RS8PrS7o X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: If the folio_nid() and numa_node_id() are the same, it indicates that the folio is already on the same node as the process. In this case, there's no need to migrate the pages. This patch adds return NUMA_NO_NODE in numa_migrate_check() when the folio_nid() and numa_node_id() match, preventing the function from executing the remaining code unnecessarily. Signed-off-by: Donet Tom --- mm/memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/memory.c b/mm/memory.c index 398c031be9ba..dfd89ff7f639 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -5509,6 +5509,7 @@ int numa_migrate_check(struct folio *folio, struct vm_fault *vmf, if (folio_nid(folio) == numa_node_id()) { count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL); *flags |= TNF_FAULT_LOCAL; + return NUMA_NO_NODE; } return mpol_misplaced(folio, vmf, addr);