Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp928649rdb; Sun, 18 Feb 2024 20:19:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXglZZ1Ng1V81QrqCOhGnRBIWjBH82nYRBfHPsdk7hMiGqlsFPXcZP9rlkipe1wl7a+Mi+vVzBf8Kenn+gDWcWoGt8BuQDIUZzw3SVhdQ== X-Google-Smtp-Source: AGHT+IHThj5YxXhwsJ/8WdWL8F2GSZWXAqvZTZ0PKtZY/uAKyOPkMGpjTIQ2lZdT6OKmc+kQ4nNL X-Received: by 2002:a05:6871:708:b0:21e:7c86:665e with SMTP id f8-20020a056871070800b0021e7c86665emr8040752oap.16.1708316392543; Sun, 18 Feb 2024 20:19:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708316392; cv=pass; d=google.com; s=arc-20160816; b=kHPBWAsuAuLhj3MrqI7iG/Lkv/W+d+Y7jdznuHvag9eC58GiH5Ob09RCRtp7zJe/aT Ddl4gcyXj995Db+OKKKSOFDcm1rpjtR0QmPDfC1mGYRYB27eD8odZ96K5NHbZc4KrrVb mv+T6WkrH1G9FWdj8lqoy1Soh+Ly8ZXCAqDcNkbFbaE6Z298J+lq902b/X/kzfVzHwQI GoaouMb++MQptENSBkxxGoqjc6+FFTtAqKv8DGn+v2egDoOA6+vIAt1u7YQMb0e45FEE TDhz8/829ZtW/2fuH0kDdkz+hXJszgmOgaMSlIjOMMQFEao7N7QkrBEk2jUVJd3O3GxW rAfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=aiOJlYGi38odNU2lVd8y4ygCQtYD12Tb2XftW5R0os0=; fh=9zEYt4zz6rI+VqvqNwRVmEtZ8tn4doHELJIRnrdpBTA=; b=h8d7T/9/XA/F2xIpPs0t0pi3ymu+YoVjcC3E9a+fjH7aqRxODxDY5HwkA61Er5bWdB cdl0Rr05XeIhxtR5tPkkhRl7pKhFvvuLHpv6aig8+uUb/mdokz+E4LueWxGb8q+NMfKO FcdVndlmh8GjjVSWR2IgQngESDjXDnjhUS9oaWmnW9/F1WKrSl4WWLT1DT4SbR1Sknxr +WHFSKCKuPyOc7wxG3i0zhXMm9NC4c1glzIi9RoaP93JjcW7/yp5n5pJ9Xzw0Ovm8eRf oSds0QbsZ3GsTtjDArbujX3NhYSP8mFlVTiPD7IqxPoTL++NOzj8BQqF/5Ci/NudJMmg jqNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-70702-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70702-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z4-20020a633304000000b005cee039f233si3685760pgz.425.2024.02.18.20.19.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 20:19:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70702-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-70702-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70702-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7C878B210C5 for ; Mon, 19 Feb 2024 04:19:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FAC72F5E; Mon, 19 Feb 2024 04:19:40 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D290C2DB for ; Mon, 19 Feb 2024 04:19:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708316379; cv=none; b=diDrE/VTMNi9ZqDYicVKl8Jcr/Fs+QGMu46mmGcaSbBqC7OIOPQsd96kbFD6G5xqhwKzMZotBuk3MwB9n4JEZTNx6m+bElELt//9ZJG2Imh8IQzQQqOer9DhExbyLKCLe4i23bCaNO18Qejn45VNKePcZFK6bJAY6AETr9K6sWw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708316379; c=relaxed/simple; bh=SuZdcutDjABnDGb72wlWOMoVWuxKROYe75I7iYPvAXo=; h=From:To:Cc:Subject:Date:Message-Id; b=gSNkmYS8lqUhtoVkyDzqZA2lZpytkZ3blT0RdOIMFmo3dYIZkwQSo5qgXRRRhG1PigIXEzmf17cq9klzDaiGYs2y0ydtIyH9vgPnQcXna1SxEolIHop8ttd+Fd25Ro3GB010CBk3IG7xAbsZ7iexc8aQ5Q2ptS9XFDhIEzK+Flk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-d85ff70000001748-51-65d2d6d3d8fa From: Byungchul Park To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, akpm@linux-foundation.org Subject: [PATCH v4] sched/numa, mm: do not try to migrate memory to memoryless nodes Date: Mon, 19 Feb 2024 13:19:20 +0900 Message-Id: <20240219041920.1183-1-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLLMWRmVeSWpSXmKPExsXC9ZZnke7la5dSDa59E7aYs34Nm8Wlx1fZ LKa/bGSxeDphK7PF3f6pLBaXd81hs7i35j+rxeR3zxgtLh1YwGRxvPcAk8W+jgdMFh1HvjFb bD36nd2B12PNvDWMHi37brF7LNhU6rF5hZbHpk+T2D3uXNvD5nFixm8Wj/f7rrJ5bD5d7fF5 k1wAVxSXTUpqTmZZapG+XQJXxsbns1gKNvBWnJz4mamB8RlXFyMnh4SAicSSjX+YYOwfS46z g9hsAuoSN278ZO5i5OIQEXjDKNG57AwbSIJZIE+i9X8fWIOwQIjE0oYpLCA2i4CqxObDvWA1 vECDHt88wwwxVF5i9YYDYIMkBFawSaw/tZYRIiEpcXDFDZYJjNwLGBlWMQpl5pXlJmbmmOhl VOZlVugl5+duYgQG4rLaP9E7GD9dCD7EKMDBqMTDmyFyKVWINbGsuDL3EKMEB7OSCK9704VU Id6UxMqq1KL8+KLSnNTiQ4zSHCxK4rxG38pThATSE0tSs1NTC1KLYLJMHJxSDYyN8W8+PtA3 dJ34wfiSmBhLs9oGmRr9XuOHJ30PfXpQ2MHqPr+8zOR57j7jm8aTZk53OuE2gSng08G9GpI2 Nyc5iawyy83ufO5tqXRs1fk4zSlR52P+BUs2rb30uFG399/ntb+znsbtP2kYc2u9msd9oU0H 34q8vpzjfL+r43U179VCaxYtsR4lluKMREMt5qLiRACJFy+iQAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCLMWRmVeSWpSXmKPExsXC5WfdrHv52qVUg8nfmSzmrF/DZnHp8VU2 i+kvG1ksnk7Yymxxt38qi8XhuSdZLS7vmsNmcW/Nf1aLye+eMVpcOrCAyeJ47wEmi30dD5gs Oo58Y7bYevQ7uwOfx5p5axg9WvbdYvdYsKnUY/MKLY9Nnyaxe9y5tofN48SM3ywe7/ddZfNY /OIDk8fm09UenzfJBXBHcdmkpOZklqUW6dslcGVsfD6LpWADb8XJiZ+ZGhifcXUxcnJICJhI /FhynB3EZhNQl7hx4ydzFyMXh4jAG0aJzmVn2EASzAJ5Eq3/+5hAbGGBEImlDVNYQGwWAVWJ zYd7wWp4gQY9vnmGGWKovMTqDQeYJzByLGBkWMUokplXlpuYmWOqV5ydUZmXWaGXnJ+7iREY Vstq/0zcwfjlsvshRgEORiUe3gyRS6lCrIllxZW5hxglOJiVRHjdmy6kCvGmJFZWpRblxxeV 5qQWH2KU5mBREuf1Ck9NEBJITyxJzU5NLUgtgskycXBKAX1ooH//0o3/OT42DI85mRJMFCN/ Kr28E7rpUw+v83wOH/1vL94vdFFMnlF7a2fLJbZ0zoj7p95mlj8zLC53+s3xU93mfXzsJy3l HQX3ZXRTjoVMkxF1Zj52KyMpYPeXje7B8/5rHJ6+j2dezqsekTLzlCKWigzDE03+Jk2mbptm /BLSEGw6o8RSnJFoqMVcVJwIAClsoz0nAgAA X-CFilter-Loop: Reflected Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Changes from v3: 1. Rewrite the comment in code and the commit message to make it more clear. (feedbacked by Oscar Salvador) 2. Add "Reviewed-by: Oscar Salvador " Changes from v2: 1. Rewrite the comment in code and the commit message becasue it turns out that this patch is not the real fix for the oops descriped. The real fix goes in another patch below: https://lore.kernel.org/lkml/20240216111502.79759-1-byungchul@sk.com/ Changes from v1: 1. Trim the verbose oops in the commit message. (feedbacked by Phil Auld) 2. Rewrite a comment in code. (feedbacked by Phil Auld) --->8--- From 98f5d472c08e3ed5b9b6543290d392a2e50fcf3c Mon Sep 17 00:00:00 2001 From: Byungchul Park Date: Mon, 19 Feb 2024 13:10:47 +0900 Subject: [PATCH v4] sched/numa, mm: do not try to migrate memory to memoryless nodes Memoryless nodes do not have any memory to migrate to, so stop trying it. Signed-off-by: Byungchul Park Reviewed-by: Oscar Salvador --- kernel/sched/fair.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d7a3c63a2171..3e3b44ae72d1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1828,6 +1828,12 @@ bool should_numa_migrate_memory(struct task_struct *p, struct folio *folio, int dst_nid = cpu_to_node(dst_cpu); int last_cpupid, this_cpupid; + /* + * Cannot migrate to memoryless nodes. + */ + if (!node_state(dst_nid, N_MEMORY)) + return false; + /* * The pages in slow memory node should be migrated according * to hot/cold instead of private/shared. -- 2.17.1