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 2DE8AC433EF for ; Tue, 5 Jul 2022 21:25:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B602E6B0071; Tue, 5 Jul 2022 17:25:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B11166B0073; Tue, 5 Jul 2022 17:25:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FF7A6B0074; Tue, 5 Jul 2022 17:25:55 -0400 (EDT) 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 92BDD6B0071 for ; Tue, 5 Jul 2022 17:25:55 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 51F2281004 for ; Tue, 5 Jul 2022 21:25:55 +0000 (UTC) X-FDA: 79654328670.14.2F8A516 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf22.hostedemail.com (Postfix) with ESMTP id E9323C0029 for ; Tue, 5 Jul 2022 21:25:50 +0000 (UTC) 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 8C291B8199F; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657056351; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mW+PfDFyMJl8QFtHjXTzslm+44ENicPmDWO/8ZLl69U=; b=cg+OhhOJEmKJl6/SaEvKLPoJI7fIbRqgnUV6GVxWe6hqezwLYz08hikb40395VIpI7r1Ue X5WXzKtVjQeHzA36HpG7T4CNZrM1xZ/0E3q0QprKWFM5ZDb+5nUY9dEVm89yXimkAb8AY3 kle6caf+Ybps1nxIinDD5onDxY5vx5M= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657056351; a=rsa-sha256; cv=none; b=DqOOh2Nsr0+jaVJmFfKAW7zieGKjRHgW6yFH3znDmKjU031CS736SouvEvI9hRL8xplH45 eZp6owQ7iKEkz/EjxPnREf55nF85HmSoOK6VHJv0NR6HPOo6CLMDCzFIy/p+LdTqpwryX4 gbwDfNNRBp9RqYqCQCuFbzxiT0qUuak= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=iseEPz9C; dmarc=none; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: wkxwf6dogci9i6so3tw6u4hgdo8ge8c7 X-Rspamd-Queue-Id: E9323C0029 X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=iseEPz9C; dmarc=none; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam10 X-HE-Tag: 1657056350-610749 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: 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?