linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: David Rientjes <rientjes@google.com>, Michal Hocko <mhocko@suse.com>
Cc: Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Christian Brauner <christian@brauner.io>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm/oom: detect and kill task which has allocation forbidden by cpuset limit
Date: Wed, 1 Sep 2021 10:44:02 +0800	[thread overview]
Message-ID: <20210901024402.GB46357@shbuild999.sh.intel.com> (raw)
In-Reply-To: <52d80e9-cf27-9a59-94fd-d27a1e2dac6f@google.com>

Hi David and Michal,

On Tue, Aug 31, 2021 at 06:06:17PM -0700, David Rientjes wrote:
> On Tue, 31 Aug 2021, Michal Hocko wrote:
> 
> > I do not like this solution TBH. We know that that it is impossible to
> > satisfy the allocation at the page allocator level so dealing with it at
> > the OOM killer level is just a bad layering and a lot of wasted cycles
> > to reach that point. Why cannot we simply fail the allocation if cpusets
> > filtering leads to an empty zone intersection?
> 
> Cpusets will guarantee our effective nodemask will include at least one 
> node in N_MEMORY (cpuset_mems_allowed()) so we'll always have at least one 
> zone in our zonelist.
> 
> Issue in this case appears to be that the zone will never satisfy 
> non-movable allocations.  I think this would be very similar to a GFP_DMA 
> allocation when bound to a node without lowmem, in which case we get a 
> page allocation failure.  We don't kill current like this patch.
 
Thanks for sharing the case, the DMA case is quite simliar. And in our usage,
the allocating task is finally killed after many OS routine/GUI tasks get
killed.

> So I'd agree in this case that it would be better to simply fail the 
> allocation.

I agree with yours and Michal's comments, putting it in the OOM code
is a little late and wastes cpu cycles.

> Feng, would you move this check to __alloc_pages_may_oom() like the other 
> special cases and simply fail rather than call into the oom killer?

Will explore more in this direction, thanks!

- Feng

  reply	other threads:[~2021-09-01  2:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  8:38 [RFC PATCH] mm/oom: detect and kill task which has allocation forbidden by cpuset limit Feng Tang
2021-08-31 15:57 ` Michal Hocko
2021-09-01  1:06   ` David Rientjes
2021-09-01  2:44     ` Feng Tang [this message]
2021-09-01 13:42       ` Feng Tang
2021-09-01 14:05         ` Michal Hocko
2021-09-02  7:34           ` Feng Tang

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=20210901024402.GB46357@shbuild999.sh.intel.com \
    --to=feng.tang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=christian@brauner.io \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).