lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YsS1+w/zWEEwFbOq@monkey>
Date:   Tue, 5 Jul 2022 15:06:51 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Gang Li <ligang.bdlg@...edance.com>,
        Muchun Song <songmuchun@...edance.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] mm, hugetlb: skip irrelevant nodes in
 show_free_areas()

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ