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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210601110840.GA80730@shbuild999.sh.intel.com>
Date:   Tue, 1 Jun 2021 19:08:40 +0800
From:   Feng Tang <feng.tang@...el.com>
To:     Michal Hocko <mhocko@...e.com>
Cc:     linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
        David Rientjes <rientjes@...gle.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Ben Widawsky <ben.widawsky@...el.com>,
        linux-kernel@...r.kernel.org,
        Andrea Arcangeli <aarcange@...hat.com>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Randy Dunlap <rdunlap@...radead.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Andi Kleen <ak@...ux.intel.com>,
        Dan Williams <dan.j.williams@...el.com>, ying.huang@...el.com
Subject: Re: [v3 PATCH 1/3] mm/mempolicy: cleanup nodemask intersection check
 for oom

On Tue, Jun 01, 2021 at 10:19:25AM +0200, Michal Hocko wrote:
> On Mon 31-05-21 22:05:54, Feng Tang wrote:
> > mempolicy_nodemask_intersects() is used in oom case to check if a
> > task may have memory allocated on some memory nodes.
> > 
> > As it's only used by OOM check, rename it to mempolicy_in_oom_domain()
> > to reduce confusion.
> > 
> > As only for 'bind' policy, the nodemask is a force requirement for
> > from where to allocate memory, only do the intesection check for it,
> > and return true for all other policies.
> 
> I would slightly rephrase the above to
> "
> mempolicy_nodemask_intersects seem to be a general purpose mempolicy
> function. In fact it is partially tailored for the OOM purpose instead.
> The oom proper is the only existing user so rename the function to make
> that purpose explicit.
> 
> While at it drop the MPOL_INTERLEAVE as those allocations never has a
> nodemask defined (see alloc_page_interleave) so this is a dead code
> and a confusing one because MPOL_INTERLEAVE is a hint rather than a hard
> requirement so it shouldn't be considered during the OOM.
> 
> The final code can be reduced to a check for MPOL_BIND which is the only
> memory policy that is a hard requirement and thus relevant to a
> constrained OOM logic.
> "

This is much clearer, thanks!

Will change this and the descrition in over-letter.

> > Suggested-by: Michal Hocko <mhocko@...e.com>
> > Signed-off-by: Feng Tang <feng.tang@...el.com>
> 
> To the change itself
> Acked-by: Michal Hocko <mhocko@...e.com>

Thanks!

- Feng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ