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: <Zegta2FEb8pkV4vz@localhost.localdomain>
Date: Wed, 6 Mar 2024 09:46:35 +0100
From: Oscar Salvador <osalvador@...e.de>
To: Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc: akpm@...ux-foundation.org, muchun.song@...ux.dev, david@...hat.com,
	linmiaohe@...wei.com, naoya.horiguchi@....com, mhocko@...nel.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] mm: hugetlb: make the hugetlb migration strategy
 consistent

On Wed, Mar 06, 2024 at 04:35:26PM +0800, Baolin Wang wrote:
> On 2024/2/28 16:41, Oscar Salvador wrote:

> >   	if (folio_test_hugetlb(src)) {
> >   		struct hstate *h = folio_hstate(src);
> > +		bool allow_fallback = false;
> > +
> > +		if ((1UL << reason) & HTLB_ALLOW_FALLBACK)
> > +			allow_fallback = true;
> 
> IMHO, users also should not be aware of these hugetlb logics.

Note that what I wrote there was ugly, because it was just a PoC.

It could be a helper e.g:

 if (hugetlb_reason_allow_alloc_fallback(reason)) (or whatever)
     allow_fallback_alloc = true

> > 
> >   		gfp_mask = htlb_modify_alloc_mask(h, gfp_mask);
> >   		return alloc_hugetlb_folio_nodemask(h, nid,
> > -						mtc->nmask, gfp_mask);
> > +						mtc->nmask, gfp_mask,
> > +						allow_fallback);
> 
> 'allow_fallback' can be confusing, that means it is 'allow_fallback' for a
> new temporary hugetlb allocation, but not 'allow_fallback' for an available
> hugetlb allocation in alloc_hugetlb_folio_nodemask().

Well, you can pick "alloc_fallback_on_alloc" which is more descriptive I
guess.

Bottomline line is that I do not think that choosing to allow
fallbacking or not here is spreading more logic than having the
htlb_modify_alloc_mask() here and not directly in
alloc_hugetlb_folio_nodemask().

As I said, code-wise looks fine, it is just that having to pass
the 'reason' all the way down and making the decision there makes
me go "meh..".


-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ