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]
Date:   Wed, 29 Nov 2017 07:57:32 +0100
From:   Michal Hocko <mhocko@...nel.org>
To:     Mike Kravetz <mike.kravetz@...cle.com>
Cc:     linux-mm@...ck.org, Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC 1/2] mm, hugetlb: unify core page allocation
 accounting and initialization

On Tue 28-11-17 13:34:53, Mike Kravetz wrote:
> On 11/28/2017 06:12 AM, Michal Hocko wrote:
[...]
> > +/*
> > + * Allocates a fresh page to the hugetlb allocator pool in the node interleaved
> > + * manner.
> > + */
> >  static int alloc_fresh_huge_page(struct hstate *h, nodemask_t *nodes_allowed)
> >  {
> >  	struct page *page;
> >  	int nr_nodes, node;
> > -	int ret = 0;
> > +	gfp_t gfp_mask = htlb_alloc_mask(h) | __GFP_THISNODE;
> >  
> >  	for_each_node_mask_to_alloc(h, nr_nodes, node, nodes_allowed) {
> > -		page = alloc_fresh_huge_page_node(h, node);
> > -		if (page) {
> > -			ret = 1;
> > +		page = __hugetlb_alloc_buddy_huge_page(h, gfp_mask,
> > +				node, nodes_allowed);
> 
> I don't have the greatest understanding of node/nodemasks, but ...
> Since __hugetlb_alloc_buddy_huge_page calls __alloc_pages_nodemask(), do
> we still need to explicitly iterate over nodes with
> for_each_node_mask_to_alloc() here?

Yes we do, because callers depend on the round robin allocation policy
which is implemented by the ugly for_each_node_mask_to_alloc. I am not
saying I like the way this is done but this is user visible thing.

Or maybe I've missunderstood the whole thing...
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ