Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp542022rdb; Sat, 17 Feb 2024 23:45:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7izvk1PwDup+g9xykxji7sFeTnZnBZhDPNhejPlNlXToF+HVjRPqKJ+qqV0xmzZrTpz6UTJHjyIP7pOwrMtIH9/BTY8f8AubBjNXZ+A== X-Google-Smtp-Source: AGHT+IEYluVNQHdfg67IGUvuktoVfR3Apjlxp3695uxD7jXJiKy0Be6AW+FMkVHtuQ8zRPVioNzb X-Received: by 2002:a17:906:dce:b0:a3e:63bd:3ad8 with SMTP id p14-20020a1709060dce00b00a3e63bd3ad8mr560187eji.8.1708242319876; Sat, 17 Feb 2024 23:45:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708242319; cv=pass; d=google.com; s=arc-20160816; b=KGYT15AXtAhekXS3TFgpfGin0IociFH16D1F6HfCj1nWztn28LBtp15m/1wP6Iu3Kb Jw741NcJ0unflfeQ6LSEcOEYQPlUPB5fFnLnCBSh5B0OrVFKTa1pbR3M2SaYDqKlEdUx iP/8WOjr92TNiHcJhh/GENDBehbD2bM2499qCTxg00+6YX2vDGQjE2XjAU5QcDlSmZAX bMSjxlHUkMiLwn2H59h1sGdoXmlxFslUh5Dg+wQqnJEASqgg0CAzx6lwnR6i5yA+nGQh EPiGphE9ZcohUAnpNfoQTEiSA5W6GyTzsqmqM340AiKRAESGRx+q8OptcMY9fIDlQ/qk Zd1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=evZe4gckZRBHDhEto05F1VL+BEBk5Sw8m/1sqWCtavg=; fh=uOmlfVp8QCBOD+RYkKSqswXJq4ToUUsDV32JMSB+t5c=; b=v84hoM3ZWilZoTqNvWlvT94nWLahSsa85bGuZDrd2IpJn66HsuIf5eH/BtZueI/qjE j0D/1Vu4VdJ8AvrrFfL/R2ovrClXmol+WfkP+M4eUPSblCI+1exi5ZriQxuF9dg4sHfs boin9ldf5ijls3li6HGk1MpbKicee+omhYyOW6VGOedhl/lQ/TEWftooSAlxahI6PpE7 fbMqcFxL6hWKy6QelaCiTCm4S21+Qt4jkJjWniboI2pSTbXKVFuWTGO8cw8yEHIb0M5I y3UuCWu9Osn/SUETe8qTdIrz7cTQZcvMugKIFW8t6ADnE100LWv/DluVuthe3eCRM/bY SIDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OzY6l413; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OzY6l413; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=zoqJA3fA; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-70252-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k27-20020a1709061c1b00b00a3e0c8f782dsi1363185ejg.301.2024.02.17.23.45.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 23:45:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70252-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OzY6l413; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OzY6l413; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=zoqJA3fA; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-70252-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6FA5F1F21DE3 for ; Sun, 18 Feb 2024 07:45:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4994EDDC3; Sun, 18 Feb 2024 07:45:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OzY6l413"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="zoqJA3fA"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OzY6l413"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="zoqJA3fA" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 939F27470 for ; Sun, 18 Feb 2024 07:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708242311; cv=none; b=iExjbJh6bImpVWg10Zi+ygbkiM7XIdYjVUqyCssXHKHhASVkcKn2CElBSMiDycLnCc/eK8Jy8ZeuM99fgVOXSfABDvlunLChAs2CoPk81AZ8Yr55LZXRx9MBlAO6GVhl2yFdyS/JVFPaSU7rjlIhRsLXrVAWgjXPTPQLJf5m6TU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708242311; c=relaxed/simple; bh=Rz4BsMjV7ldBGPlX4IskfMs6om3XDfI7hFwAe52EV0M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nGVzzV84dhXkP7oC0WOwGvX4XGi9yn8BcegIcNUetySx1nvbB2QfbKq67BBv5QBM1iMnx1yU/cdJ503YUsHdyugQyIBczSB5ZXGMBN5Fx+PNFXf5+0ZwZAXCj9fWMzwB5pSfP0D2B7heqpssPUhgoANSWcKISUEZKN4jXxTFo7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OzY6l413; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=zoqJA3fA; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OzY6l413; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=zoqJA3fA; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7FC111FBF2; Sun, 18 Feb 2024 07:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708242305; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=evZe4gckZRBHDhEto05F1VL+BEBk5Sw8m/1sqWCtavg=; b=OzY6l413AqV4NamRaozr+xOUFtfEXlLQ7MgbOxFYE5nHINtEwheLgKGD3oxK+tWA/LWMfP +sB/ewyB2QysnXjnaIgGaEtlMk2BqbpQL6zsXVBKxaw3LX9a/w24zYzbZXXFtnvWDdRTbJ hKd3aPSXYtZfTiYhBDBxTdWpfc6xt6g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708242305; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=evZe4gckZRBHDhEto05F1VL+BEBk5Sw8m/1sqWCtavg=; b=zoqJA3fAcIDCyvFIG4LK3eK8/G6U9OLxJxCQtkTiOaBRI5QRS6DFGpFV3SJKEZow1TP6cv 3CXhsc8JAs9Pe9DA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708242305; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=evZe4gckZRBHDhEto05F1VL+BEBk5Sw8m/1sqWCtavg=; b=OzY6l413AqV4NamRaozr+xOUFtfEXlLQ7MgbOxFYE5nHINtEwheLgKGD3oxK+tWA/LWMfP +sB/ewyB2QysnXjnaIgGaEtlMk2BqbpQL6zsXVBKxaw3LX9a/w24zYzbZXXFtnvWDdRTbJ hKd3aPSXYtZfTiYhBDBxTdWpfc6xt6g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708242305; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=evZe4gckZRBHDhEto05F1VL+BEBk5Sw8m/1sqWCtavg=; b=zoqJA3fAcIDCyvFIG4LK3eK8/G6U9OLxJxCQtkTiOaBRI5QRS6DFGpFV3SJKEZow1TP6cv 3CXhsc8JAs9Pe9DA== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id A447413343; Sun, 18 Feb 2024 07:45:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 1QK8JIC10WUaVQAAn2gu4w (envelope-from ); Sun, 18 Feb 2024 07:45:04 +0000 Date: Sun, 18 Feb 2024 08:46:16 +0100 From: Oscar Salvador To: Byungchul Park 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: 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: Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-3.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[15]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -3.10 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" Thinking some more, promote might be misleading, just something like "do not try to migrate memory to memoryless nodes". As this is not a bug fix but an optimization, as we will fail anyways in migrate_misplaced_folio() when migrate_balanced_pgdat() notices that we do not have any memory on that code. With the other comments addressed: Reviewed-by: Oscar Salvador > > 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? > > > 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." > > > > 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. > > 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 > -- Oscar Salvador SUSE Labs