linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Gang Li <ligang.bdlg@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] mm, hugetlb: skip irrelevant nodes in show_free_areas()
Date: Tue, 5 Jul 2022 15:06:51 -0700	[thread overview]
Message-ID: <YsS1+w/zWEEwFbOq@monkey> (raw)
In-Reply-To: <20220705142547.da3ea5a7383a7eeec3a93665@linux-foundation.org>

On 07/05/22 14:25, Andrew Morton wrote:
> On Tue,  5 Jul 2022 17:21:19 +0800 Gang Li <ligang.bdlg@bytedance.com> 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?
> 

I do not believe that is possible.

IIUC, all memory blocks of a node must be offline for the node to be
marked offline.  To offline a memory block, all hugetlb pages must be
removed from the memory block.  So, an offline node should have no
hugetlb pages.  And, if there are no hugetlb pages it makes no sense to
call hugetlb_show_meminfo_node.

Also, previous code in show_free_areas skips offline nodes.  So, this
new code would be consistent with existing code.
-- 
Mike Kravetz


  reply	other threads:[~2022-07-05 22:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05  9:21 Gang Li
2022-07-05  9:33 ` Muchun Song
2022-07-05 21:25 ` Andrew Morton
2022-07-05 22:06   ` Mike Kravetz [this message]
2022-07-05 22:54 ` Mike Kravetz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YsS1+w/zWEEwFbOq@monkey \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=ligang.bdlg@bytedance.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=songmuchun@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox