From mboxrd@z Thu Jan 1 00:00:00 1970 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 57B02C48BC3 for ; Mon, 19 Feb 2024 15:01:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8FFBC6B0075; Mon, 19 Feb 2024 10:01:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AFAE6B0078; Mon, 19 Feb 2024 10:01:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7505A6B007B; Mon, 19 Feb 2024 10:01:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 613376B0075 for ; Mon, 19 Feb 2024 10:01:06 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B3371160424 for ; Mon, 19 Feb 2024 15:01:04 +0000 (UTC) X-FDA: 81808866048.04.99B1CB8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf30.hostedemail.com (Postfix) with ESMTP id 53EB980029 for ; Mon, 19 Feb 2024 15:01:00 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AuWLj+ph; spf=pass (imf30.hostedemail.com: domain of pauld@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=pauld@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708354860; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=q5dBDj1kDlmWCbGoSjQ1BBTQ4aeYU8rqDaj67mpl6Gs=; b=N0vH5RN9fNVqS4YF0NrGdqmS93Vz5KcjU/1RaKYzXGcbbFIT+P6mWpbRMemfjr2ocSOacy ucu8odgmmur3lX34z3M1E46G47ovFK+SJVwEAMxx1206J5SUPlPjmb5UvWTBP/QxmAtW20 auppLb8HnjOAnDYDKBVihW7ADhAnijk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708354860; a=rsa-sha256; cv=none; b=aOgQ0y4vTry5TvQ29HfviDzJQ3cod5s/c6kepCo6q4Cl1Dr8l+vk6mosNLYGTSWc419YY0 /Bj+Re6IkVgG63M0oIpfsNn03pvy8DUMrcNq5A5SsMzg2aV5jT29NE89zBLLErFNpPPRzG bmmDLSy7pKbxgRGEr1+UvekMCeJvYr4= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AuWLj+ph; spf=pass (imf30.hostedemail.com: domain of pauld@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=pauld@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708354859; h=from:from:reply-to:subject:subject: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=q5dBDj1kDlmWCbGoSjQ1BBTQ4aeYU8rqDaj67mpl6Gs=; b=AuWLj+phrIW0C9uvBC9kKInP5tssrbtsz8Y2UBwBCbfJLkG2/wcGyLBMe86pK+uOZAyhGD 2vwpuxL7mkgEOvmmim/1Ncg/WU31o/JZvlTLenhTzBIIrM+1WQLBlSmx0V2jIYQZA6UDOA bzNQwiwLwY/QEoC7ED5w+HJzXcULVd8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-581-ThxWcfgWNUGCd941DoO2fQ-1; Mon, 19 Feb 2024 10:00:55 -0500 X-MC-Unique: ThxWcfgWNUGCd941DoO2fQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C4BA886461; Mon, 19 Feb 2024 15:00:54 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.39.195.107]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68EB524E4; Mon, 19 Feb 2024 15:00:47 +0000 (UTC) Date: Mon, 19 Feb 2024 10:00:43 -0500 From: Phil Auld To: Byungchul Park Cc: Oscar Salvador , 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: <20240219150043.GA184804@lorien.usersys.redhat.com> References: <20240216114045.24828-1-byungchul@sk.com> <20240219020854.GA65758@system.software.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240219020854.GA65758@system.software.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Stat-Signature: guugmcbqcipkpk3xrnr838957ur6wm1n X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 53EB980029 X-Rspam-User: X-HE-Tag: 1708354860-227899 X-HE-Meta: U2FsdGVkX19Nf3gfE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nNMFZ3r0pxhZ9oGL12A6r2/gmdCZdY8M9o78a8vchZRoBJku+MxPuYbmhqpW3qBeD2WLTgbGt/KfMkOpasvZCBjtix57cpAKEX4P9VZMpiHd/n6g7y+D9Q/FnRJGZrb/owajzZfYuIATsf9ohX60oWMi624MEUKRa0Wu1wB4/2cOquBswguqE= 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: On Mon, Feb 19, 2024 at 11:08:54AM +0900 Byungchul Park wrote: > 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. > We clearly have dst_cpu when we call this so I still think a check could be done farther up. But this one still looks reasonable to me. Thanks, Phil Reviewed-by: Phil Auld > 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 > --