From patchwork Mon Feb 19 04:19:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungchul Park X-Patchwork-Id: 13562162 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 3F83BC48260 for ; Mon, 19 Feb 2024 04:19:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 526E68D0003; Sun, 18 Feb 2024 23:19:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D5498D0002; Sun, 18 Feb 2024 23:19:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39DD18D0003; Sun, 18 Feb 2024 23:19:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 29D078D0002 for ; Sun, 18 Feb 2024 23:19:43 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 93CEC1A01E4 for ; Mon, 19 Feb 2024 04:19:42 +0000 (UTC) X-FDA: 81807249804.21.6DD2C04 Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf02.hostedemail.com (Postfix) with ESMTP id 988B380002 for ; Mon, 19 Feb 2024 04:19:38 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf02.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708316381; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=aiOJlYGi38odNU2lVd8y4ygCQtYD12Tb2XftW5R0os0=; b=PAgjd8jIRU6c0KtdNF/EL4f01PG1t60MpFDXKCeb11EX2HpFKyL3m0oAU6txlXHy8ACxZq X4tC6MbX6ciV7/OT7poOfkA16mQETjZYZszc2U/NN7cG7NukI58mlqj1X4tdJGq3HSrdyx tVFYMA0EpLiCp/sEE5O5NRtzRHq19E0= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf02.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708316381; a=rsa-sha256; cv=none; b=raYRzkteEGYH/1cVaJElaUa1VIk472SVMh+O0GUtA6yGKEFwyoANQGWWBlWEnmW/5MNY43 MX/TjtVJI/ATtjh1rmGZGJyWPhYFxnBFsOI6Vd+cVhhns3Xjil8QJLW/TY/0EZZLI513eB sNudRmR2kr0G0AIzGQtfcwKDBbXusr4= 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+rxeR3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GBkWMUokplXlpuYmWOqV5ydUZmXWaGXnJ+7iREY Vstq/0zcwfjlsvshRgEORiUe3gyRS6lCrIllxZW5hxglOJiVRHjdmy6kCvGmJFZWpRblxxeV 5qQWH2KU5mBREuf1Ck9NEBJITyxJzU5NLUgtgskycXBKAX1ooH//0o3/OT42DI85mRJMFCN/ Kr28E7rpUw+v83wOH/1vL94vdFFMnlF7a2fLJbZ0zoj7p95mlj8zLC53+s3xU93mfXzsJy3l HQX3ZXRTjoVMkxF1Zj52KyMpYPeXje7B8/5rHJ6+j2dezqsekTLzlCKWigzDE03+Jk2mbptm /BLSEGw6o8RSnJFoqMVcVJwIAClsoz0nAgAA X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 988B380002 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: qiebyfuws77w6aufxqiw78g9m8tyjq4u X-HE-Tag: 1708316378-861856 X-HE-Meta: U2FsdGVkX1/FozK0aZkqeP6yTTCuQXomSQu7phHhmuCBlVEdFPtTpdoNhznNCxXpA63krH26tqM4bmHXqrpvpebbJKKYFnciD+7lG/WD22T8O5QBj+xOPkG27koHAWs0Aju6enhBXpnQve9COYvsN/I/wPkMplWQ5sZY6/5IP91WJqfN9iv93PDeq3uW+QioJSrCOMHN/lYesLpZv9+iEdrW20C0mMVD6QyxOsHrRc/SKLhcpKjf+U42fxoxOsRCXkGtEReZjZHZpW8/S0WwOr1WOKpLbEPmS1tC3GbeQRrDsg/P/bDmYVYOan8TX8jrHEaYK2nRVBa9yd3jIQbuJ/tbupq6HSOOtDHyyU7pkxaurAAJYxcDz+lqg+ajVlXZHBr0qpZ1/2SNAd8RqrGuMkimQVMFHKlEkWdf5Q9BjCzgK4eBDchTEcymwnMo52lVIxQ30sIzCwmbl+D2bFPw5c05jRhUAOtUu0i0JLmmuybpUo7WwVdtYnMJcuFXk6OVg1C67l2PkfgzMLLdJsxman1ZFMQotxGVGyO/22LwnK/HQDTlFeweVXkGAYO7/4F7bJgZ9pWQuB2KY6P3tnTGCmH/i5h6vNXJOZFU5JeioDTxot6ClhJA/cacp6eXmrTYU9MXMa8JTeKlkjj/EgF/UflB54UG4Xk9It+jH+aUgt1S4d5+azUHmxc+Q2+gKL2B4fmlCzYbxMPmeWRfLjpxqihTw4R4NR1CJPOTuAroe7+dE1qyuiqZT4mxW2Yx16CA7E2F9WjQb5B96TEXc12kxK/DY/QJ/ETWDwWB0Tcr6tyUBuElr/K14yaeDg/lCpRtbqoTJElSaP8cbIx8u7ykiqxG/kdXM/HGVaRtli7H9RIxnCsg6J2Fmp9vic7B9NeLec5zYn/hFFkcYR2brdiV789wxAGOXCnSl5e4K79Qjo9ruISjqkEeOHtTvnNOXvjge+cJP4O77oC+4P7egoF FDeBr6Tn sbejFO1b6zivPP1arEFsg9TAB+k2pL7wW+sJo/+8qEZRi54k= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.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 Reviewed-by: "Huang, Ying" Reviewed-by: Phil Auld Signed-off-by: Byungchul Park Reviewed-by: Oscar Salvador Reviewed-by: "Huang, Ying" Reviewed-by: Phil Auld Signed-off-by: Andrew Morton --- 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.