Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp895232rdb; Sun, 18 Feb 2024 18:09:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVLQkTWH0XJSrhDJSI6EiWQJXxqc9It33zeIhtYVaPpq+H6tD/3HlobocDvUbolUql5gYqDmBmIf/zIegMeeR+5DWzdgkarMKlu8qXM+g== X-Google-Smtp-Source: AGHT+IG1o6WDzp1Q8rkbKCr9odVJUigMDpLh0dO3RlVG+KqrTGVkwT3fHae2dAOyshqRg+megaM5 X-Received: by 2002:a1f:c406:0:b0:4c8:cb19:f6a1 with SMTP id u6-20020a1fc406000000b004c8cb19f6a1mr1286283vkf.16.1708308561933; Sun, 18 Feb 2024 18:09:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708308561; cv=pass; d=google.com; s=arc-20160816; b=Es1QG0oZokrQY6+cmk207Rg/mz0+9qL7H4mnNsibFyJTs229FVE69vXOfE35Of/ruC TsaCrZQfqaM/VRwlrv1w3itiahx1l4GcgPV3YNyPSN4hS0tyHbtW/1MJa7DlokBWtERt Tq+9eTgbpERbhTwbjQGzNszt17lswDhUZ32ktipGc0k4bUrGkPUro0hTRaC4rW9gfUyD 2/Vy35i9WjvQRWEhVxZxAQ+HavLzLaAnJZrQTKYXDVsgAj+YTRFeZ02St6CMwLZx1fXs wUoE+XWtUzgWOb/3SELZJOqS0P/CiITGhxB/MewiYMb3A7Ut2CDU8NI/JJVZtUfop9zd b9oQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=bakTu0Wgr+lpD3iZQrWCbmV1QY8l1NopcS9Pm1xX/7c=; fh=H1AXMuko56EfY+4pMcUqDLIow0rsGAnFgbDVYODEbGY=; b=VhgLlXyKaTrC4zP2wxsgURi+VmgqAoukwCsyDrZgaCLTOFUFqqNCDQhKaSZzda2idF tL/HuMBMH9HvMBZ5N+YPmiXA4aYnR3J58WKf2bPotrfNPsML+TJWjONnwgkA/YaJyUuU M5GSI3Ha4/EeWwENtXoHYtNFVYbzcmnRh0n+VSFApQD8bRxbJhFX/G/bRT7dE8ClZdru iDuRsAU6n/+voXxbswjFP5NGq7Uq0r7WaVH9DtixATiTPjJrY1vRFmhubqKRRcifHnCe DXZT+8RVZYwcaEEDgju6LDCkWy9NBCPuazI1bdAbiiWktxQkcGIVJepBRRQwh9HLv/jS Sewg==; 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-70643-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70643-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 10-20020a0562140cca00b0068cbc82e484si5277147qvx.303.2024.02.18.18.09.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 18:09:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70643-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-70643-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70643-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AC9141C209CC for ; Mon, 19 Feb 2024 02:09:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1122A23BC; Mon, 19 Feb 2024 02:09:15 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3804111E for ; Mon, 19 Feb 2024 02:09:07 +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=1708308554; cv=none; b=HPGPHUagm/rJOsJ+50bxMvcM5jHs2DEpQRAx1C4pomrwYjGRP8xf7ExsET+kTepPhNvw3T8zvgIwEnASZ538QwvWnOEjiT4wI0K0+StvgjrYp7/xtUp7DeWC8xqTW8+CAdVKKv6l//xEnUZmIFsoNZwsOGwf2BDukU70XTxw3O4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708308554; c=relaxed/simple; bh=VucQDZvXBlsqG5aAZy4X/qs2OO3VqrPK8ZAKjKSlJXc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FL8He1nV+t+VBora5vXKMMhdEnRkF5N7KoTlg8aa2PTYmpcIRYJvQ4HwEwh6ChreiYEZpQxyj4VOpCBA1oY7Q5JbfZ/DZLUu0lkbZ5UeXZ/oJcKsxOPBfUy/GljWcspckX8CWDVy+miSJiY3cMPh3l1DKl+FdM74JT3JX0PcnyI= 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-d6dff70000001748-7b-65d2b83c33aa Date: Mon, 19 Feb 2024 11:08:54 +0900 From: Byungchul Park To: Oscar Salvador Cc: 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, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, akpm@linux-foundation.org Subject: Re: [PATCH v3] sched/numa, mm: do not promote folios to nodes not set N_MEMORY Message-ID: <20240219020854.GA65758@system.software.com> References: <20240216114045.24828-1-byungchul@sk.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42LhesuzUNdmx6VUg+s/JCzmrF/DZnHp8VU2 i+kvG1ksnk7Yymxxt38qi8XlXXPYLO6t+c9qMfndM0aLSwcWMFmcmVZkcbz3AJPFvo4HTBYd R74xW2w9+p3dgc9jzbw1jB4t+26xeyzYVOqxeYWWx6ZPk9g97lzbw+ZxYsZvFo/3+66yeWw+ Xe3xeZNcAFcUl01Kak5mWWqRvl0CV8b67l+sBQsEKnp+T2BsYLzH08XIySEhYCLR27ubCcZe v3AyI4jNIqAqsffGFzCbTUBd4saNn8wgtoiAmsS0V43sXYxcHMwCp5gkJny+AORwcAgLREoc eisIUsMrYCEx7+xHVpCwkECCxJ/L7hBhQYmTM5+wgNjMAloSN/69ZAIpYRaQllj+jwMkzClg KrHoynp2EFtUQFniwLbjTCCbJASa2SXazq9jhThTUuLgihssExgFZiEZOwvJ2FkIYxcwMq9i FMrMK8tNzMwx0cuozMus0EvOz93ECIykZbV/oncwfroQfIhRgINRiYc3Q+RSqhBrYllxZe4h RgkOZiURXvemC6lCvCmJlVWpRfnxRaU5q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0lluKMREMt5qLiRACSVU0DhwIAAA== X-CFilter-Loop: Reflected On Fri, Feb 16, 2024 at 02:51:24PM +0100, Oscar Salvador wrote: > On Fri, Feb 16, 2024 at 08:40:45PM +0900, Byungchul Park wrote: > > From 150af2f78e19217a1d03e47e3ee5279684590fb4 Mon Sep 17 00:00:00 2001 > > From: Byungchul Park > > Date: Fri, 16 Feb 2024 20:18:10 +0900 > > Subject: [PATCH v3] sched/numa, mm: do not promote folios to nodes not set N_MEMORY > > "do not try to promote folios to memoryless nodes" Thank you. I will. > because AFAICS we are just trying. > Even if should_numa_migrate_memory() returns true, I assume that we will > fail somewhere down the chain e.g: migrate_pages() when we see that this > node does not any memory, right? Yes. > > A numa node might not have its local memory but CPUs. Promoting a folio > > to the node's local memory is nonsense. So avoid nodes not set N_MEMORY > > from getting promoted. > > If you talk about memoryless nodes everybody gets it better IMHO. > "Memoryless nodes do not have any memory to migrate to, so stop trying it." Much better. > > Signed-off-by: Byungchul Park > > --- > > kernel/sched/fair.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index d7a3c63a2171..7ed9ef3c0134 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -1828,6 +1828,13 @@ 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; > > > > + /* > > + * A node of dst_nid might not have its local memory. Promoting > > + * a folio to the node is meaningless. > > + */ > > + if (!node_state(dst_nid, N_MEMORY)) > > + return false; > > "Cannot migrate to memoryless nodes" > > seems shorter and more clear. Agree. Byungchul > So, what happens when we return true here? will we fail at > migrate_pages() I guess? That is quite down the road so I guess > this check can save us some time. > > > -- > Oscar Salvador > SUSE Labs