Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1728489imw; Tue, 5 Jul 2022 14:33:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vkMz3ZPLOGYn1I9Ba5mhvN6G8u1CrsvJo3hPYEcDgNkeqg6efKQPgH7etR3foICz0ttLhP X-Received: by 2002:a05:6a00:1a8b:b0:525:9c4f:ade5 with SMTP id e11-20020a056a001a8b00b005259c4fade5mr44473805pfv.74.1657056792042; Tue, 05 Jul 2022 14:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657056792; cv=none; d=google.com; s=arc-20160816; b=M+eyPjkg1unxN2dMjv+/zwmdwcDQ0iPxEkZQLe841aKa8qHKEpuo36/SnZjLUTKenx X1xkCZloYuGEGsQF+VFKeBmtPpD/XWCsg6/kvkf2MVOkf4YNccHjcXBAm2oGhCJy4EPU 6WkTWu+z0cHyQuWJkKs9hDZjHHzDiE6j2b9Ge0X5wIM4PsEg3J5DAy3Ow9/mE8dzFRL4 TF9llM00S6sfRysZpQhrkvNlFaJj9PGkio/yWYrmbJzuUTKcjssp23UMT5zotvUBGN59 I4L5uGxDxRY1x8+XhXTWE+08ag9ftaxSUNOc7o219/dC7aD4E0ejglNDpe/Buhh3rkl3 T2UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mW+PfDFyMJl8QFtHjXTzslm+44ENicPmDWO/8ZLl69U=; b=yU8SKBSyZZbaiySbVM+E1a4PVwKBvqpg+SN6zNfe7kWzyf4+7upDfAw3W08LFNTek5 SKIobQIVxmvnvu5QnpbwuyJ24AZ2j5lq9r6josTNv/hFfecOkod0d/afJbdgN/jVc6Ro 9bBellDJcoY6i5TMeekBiU2n5X1hHrZmpa5CnXrNqPGma5uubI82BVru9PcKs+ITdw2T 4zhzuV/Y9S4oNNJViE4CeEOmyouepFKTdSED9zF/NihEDZVJQkGUUqIA1G0CEmgngrcJ ixS1NQ3Tnv+oFt/vd80UhQgD+/Op9H2okP7DySz9RQF+mOpv0dNnzh/TaHHfuhP6H6n+ kM6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=iseEPz9C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a170902f78700b0016a3e914a18si41365458pln.506.2022.07.05.14.33.00; Tue, 05 Jul 2022 14:33:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=iseEPz9C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230332AbiGEVZw (ORCPT + 99 others); Tue, 5 Jul 2022 17:25:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiGEVZv (ORCPT ); Tue, 5 Jul 2022 17:25:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8BE7DF3C for ; Tue, 5 Jul 2022 14:25:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8704DB8181D for ; Tue, 5 Jul 2022 21:25:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EC10C341C7; Tue, 5 Jul 2022 21:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1657056348; bh=qgaHL+Oy4XLYeWHuy+YRXq0lAlKIINOPcoxSgLDujR8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iseEPz9CBsjg0Ck3NM7/woJoafbfgFUfYuM6DDdvrqEu75mNKvFn6LRWQgKXe+uCO 4KV3fYifHbNp6obLmBXzNX3eapYC8oDFhq3/HiSPA+9ARBQ38LzOgbPQaq3IW9DL6n 2x3nwA79TM5rk+2vKndeTqazOYmTNUWsj9SGGraw= Date: Tue, 5 Jul 2022 14:25:47 -0700 From: Andrew Morton To: Gang Li Cc: Mike Kravetz , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm, hugetlb: skip irrelevant nodes in show_free_areas() Message-Id: <20220705142547.da3ea5a7383a7eeec3a93665@linux-foundation.org> In-Reply-To: <20220705092120.2158-1-ligang.bdlg@bytedance.com> References: <20220705092120.2158-1-ligang.bdlg@bytedance.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Jul 2022 17:21:19 +0800 Gang Li wrote: > show_free_areas() allows to filter out node specific data which is > irrelevant to the allocation request. But hugetlb_show_meminfo() still > shows hugetlb on all nodes, which is redundant and unnecessary. > > Use show_mem_node_skip() to skip irrelevant nodes. And replace > hugetlb_show_meminfo() with hugetlb_show_meminfo_node(nid). It would be helpful to include before-and-after sample output text in the changelog to help others assess the proposed change. > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -6202,7 +6202,11 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask) > printk(KERN_CONT "= %lukB\n", K(total)); > } > > - hugetlb_show_meminfo(); > + for_each_online_node(nid) { > + if (show_mem_node_skip(filter, nid, nodemask)) > + continue; > + hugetlb_show_meminfo_node(nid); > + } > Does this mean that potentially useful info about presently-offline nodes will no longer be available?