All of lore.kernel.org
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: Michal Hocko <mhocko@suse.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Ben Widawsky <ben.widawsky@intel.com>,
	linux-kernel@vger.kernel.org,
	Andrea Arcangeli <aarcange@redhat.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Vlastimil Babka <vbabka@suse.cz>, Andi Kleen <ak@linux.intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	ying.huang@intel.com
Subject: Re: [v3 PATCH 1/3] mm/mempolicy: cleanup nodemask intersection check for oom
Date: Tue, 1 Jun 2021 19:08:40 +0800	[thread overview]
Message-ID: <20210601110840.GA80730@shbuild999.sh.intel.com> (raw)
In-Reply-To: <YLXtjRYUcaXcYfua@dhcp22.suse.cz>

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@suse.com>
> > Signed-off-by: Feng Tang <feng.tang@intel.com>
> 
> To the change itself
> Acked-by: Michal Hocko <mhocko@suse.com>

Thanks!

- Feng

  reply	other threads:[~2021-06-01 11:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 14:05 [v3 PATCH 0/3] mm/mempolicy: some fix and semantics cleanup Feng Tang
2021-05-31 14:05 ` [v3 PATCH 1/3] mm/mempolicy: cleanup nodemask intersection check for oom Feng Tang
2021-06-01  8:19   ` Michal Hocko
2021-06-01 11:08     ` Feng Tang [this message]
2021-06-01 23:56       ` Andrew Morton
2021-05-31 14:05 ` [v3 PATCH 2/3] mm/mempolicy: don't handle MPOL_LOCAL like a fake MPOL_PREFERRED policy Feng Tang
2021-06-01  8:44   ` Michal Hocko
2021-06-01 11:29     ` Feng Tang
2021-05-31 14:05 ` [v3 PATCH 3/3] mm/mempolicy: unify the parameter sanity check for mbind and set_mempolicy Feng Tang
2021-06-01  8:46   ` Michal Hocko
2021-05-31 21:41 ` [v3 PATCH 0/3] mm/mempolicy: some fix and semantics cleanup Andrew Morton
2021-06-01  0:55   ` Feng Tang
2021-06-01  8:48     ` Michal Hocko

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=20210601110840.GA80730@shbuild999.sh.intel.com \
    --to=feng.tang@intel.com \
    --cc=aarcange@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ben.widawsky@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    --cc=rdunlap@infradead.org \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    --cc=ying.huang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.