Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3280143rdb; Tue, 6 Feb 2024 12:32:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjxQOPwpkPYoELaiqtOnW72VA9ePHU3liJoBmSkLnzCYCb/ekyEDTnB/TvLOmY0tOv92U7 X-Received: by 2002:a17:906:b782:b0:a37:2566:e248 with SMTP id dt2-20020a170906b78200b00a372566e248mr2761182ejb.37.1707251551123; Tue, 06 Feb 2024 12:32:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707251551; cv=pass; d=google.com; s=arc-20160816; b=toCAUq1WOhenST45Tj/CBTg8riAAYFoIPMjQCIutIqrHUV0JZk0VjF8Jx+2jEP62N1 F6VJwNbp3+67CmvoyIk+dGjWuAwvxqE2x2ZX6OEmZ/U7mbEzjlflrSskJkclMvfUDdse 7Z5kXlFaw7yLBOFy98ve4W/1CMO+mUko+SL3Dok/UegbeVHsFg+6h2bGYXEEFWZKURJ7 wd0UASPK7jkx3P722eI5iFX7OJkEhQwE2qJ0KiOllWmxNakxmJ/WEUuNPbFfpvlVHA+j H6bY/9HVqbplSO2ql3YVXXFXORTSKJmThL0H3IPlmEHMjwyECyfB607cB0HkCV5MlNxz Zp8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=07GLsY3wGCdeQZHm7Fg/VGTYyeyPIhloUHT+HXWDZbs=; fh=nL2i6sASnni6CeA0YJ1+e0aCapArWCJhFZkwTH2/F58=; b=BY7/pP2fCUrIexoKw6CUsuhYYwrQDR2CgBXiplGTkfCsqUwCq3GRWRJ3ejmkjZX5MK 2oJY/indX7mmrYdYz2bJoRCzBvPsyheRGXCaxrcmtENjPKCCIMfhmltvBBIiUWhax8bh aihUDZfmTNFeQ5Huy5980QWgBIEcSOMSTGDwNedP2/FjyiMUjen5aGHz5iQ4faiK4z/S WhNfwQ9589aJ4V+Cls5twqy+faErjQbsDiZ+Qwkn2SME1V4+mfs0UTJdZmfeW8scJCbe bTlJ2dZR3YL5X14bguQqcHeqJEnA9dOGNxFFtpsFOw6Ak/V2M4Pt9kGLlmmEcvJxdkZX iucw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=WqRutX0z; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-55593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55593-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXOb5RSyB2+L958ZuGp15MyDef86+MnCi0cpCw6U96ZAYGjkk4XCYvweBW/R8Mb4qMtvZcUnWWb9hbR9OzCKfAdxXWXESiYcmpnNU3esQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gl8-20020a170906e0c800b00a36c39234bdsi1460134ejb.488.2024.02.06.12.32.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 12:32:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55593-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=@linux-foundation.org header.s=korg header.b=WqRutX0z; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-55593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55593-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5E9C61F2992E for ; Tue, 6 Feb 2024 20:23:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DD1D1B285; Tue, 6 Feb 2024 20:23:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="WqRutX0z" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4405D1AACF for ; Tue, 6 Feb 2024 20:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707251026; cv=none; b=dG8+nX6oz/1VI3tkvlLH/DH3fCou8tSCca3/aQM/obCk8SxcZELuj7JGfB5cquB3Q3QmV3pr9mAz3xf2JaUxtqbEKUzbSauby2MYv8riIFysqbzN3+77l8qPkGBbNdlr4tWEC1Cxes1ajctteziVYhZfoHVIS/NtLtzSLe9Lwu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707251026; c=relaxed/simple; bh=R3Gvp712DLBLHZrUWRKpfJXFpWCymIU4evTbHKyLl8w=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=p2NYMwApCiAL8u2m8ZlW28aNrXwN8pOttjvGRZkxo80W4yV0c97k2mWwBc56Zc6a1OS/xjsmi2meJKXC4JLcC7lcOsEklTopDgdarRfQmVRI9jDHNqDQz7PB4T4HuEh6tcQbqbjzrqfuovq8JleN5gA2xsba4T+jRvjbdcHlPaE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=WqRutX0z; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84F09C433C7; Tue, 6 Feb 2024 20:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1707251025; bh=R3Gvp712DLBLHZrUWRKpfJXFpWCymIU4evTbHKyLl8w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WqRutX0z7G4glv+gctBfnfBw81mKOeIYgGNtrpvvn1O8Np/rV9zimnIH30YuEmrZJ RCozwJf130thBphzjwKFkJaCetuHAZhyUCmyN7dA9ma9CA5iV0y+dodnJ+6Sdayvuy MVIabme+wrBOkzqAVNPqTO0pRZxK6DzEB3/jtNOk= Date: Tue, 6 Feb 2024 12:23:44 -0800 From: Andrew Morton To: Li Zhijian Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Huang, Ying" , "Aneesh Kumar K . V" Subject: Re: [PATCH v2] mm/demotion: print demotion targets Message-Id: <20240206122344.4cd39c6ebb37871912c459fe@linux-foundation.org> In-Reply-To: <20240206020151.605516-1-lizhijian@fujitsu.com> References: <20240206020151.605516-1-lizhijian@fujitsu.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Tue, 6 Feb 2024 10:01:51 +0800 Li Zhijian wrote: > Currently, when a demotion occurs, it will prioritize selecting a node > from the preferred targets as the destination node for the demotion. If > the preferred node does not meet the requirements, it will try from all > the lower memory tier nodes until it finds a suitable demotion destination > node or ultimately fails. > > However, the demotion target information isn't exposed to the users, > especially the preferred target information, which relies on more factors. > This makes users hard to understand the exact demotion behavior. > > Rather than having a new sys interface to expose this information, > printing directly to kernel messages, just like the current page > allocation fallback order does. > > ... > > --- a/mm/memory-tiers.c > +++ b/mm/memory-tiers.c > @@ -359,6 +359,26 @@ static void disable_all_demotion_targets(void) > synchronize_rcu(); > } > > +static void dump_demotion_targets(void) Unrelated, but... establish_demotion_targets() should be __meminit, so dump_demotion_targets() could also be __meminit.