linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shakeel Butt <shakeelb@google.com>,
	Muchun Song <muchun.song@linux.dev>, Tejun Heo <tj@kernel.org>,
	Dan Schatzberg <schatzberg.dan@gmail.com>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: memcontrol: don't throttle dying tasks on memory.high
Date: Fri, 12 Jan 2024 18:23:45 +0100	[thread overview]
Message-ID: <ZaF1oQyovAOMA3be@tiehlicka> (raw)
In-Reply-To: <ZaFyiTFC-ped0IdA@P9FQF9L96D.corp.robot.car>

On Fri 12-01-24 09:10:33, Roman Gushchin wrote:
> On Fri, Jan 12, 2024 at 06:06:39PM +0100, Michal Hocko wrote:
> > On Thu 11-01-24 14:28:07, Johannes Weiner wrote:
> > [...]
> > > @@ -2867,11 +2882,17 @@ static int try_charge_memcg(struct mem_cgroup *memcg, gfp_t gfp_mask,
> > >  		}
> > >  	} while ((memcg = parent_mem_cgroup(memcg)));
> > >  
> > > +	/*
> > > +	 * Reclaim is set up above to be called from the userland
> > > +	 * return path. But also attempt synchronous reclaim to avoid
> > > +	 * excessive overrun while the task is still inside the
> > > +	 * kernel. If this is successful, the return path will see it
> > > +	 * when it rechecks the overage and simply bail out.
> > > +	 */
> > >  	if (current->memcg_nr_pages_over_high > MEMCG_CHARGE_BATCH &&
> > >  	    !(current->flags & PF_MEMALLOC) &&
> > > -	    gfpflags_allow_blocking(gfp_mask)) {
> > > +	    gfpflags_allow_blocking(gfp_mask))
> > >  		mem_cgroup_handle_over_high(gfp_mask);
> > 
> > Have you lost the check for the dying task here?
> 
> It was moved into mem_cgroup_handle_over_high()'s body.

Ohh, right. Somehow overlooked that even when I was staring at that
path.

Acked-by: Michal Hocko <mhocko@suse.com>

Thanks!

-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2024-01-12 17:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11 13:29 Johannes Weiner
2024-01-11 13:55 ` Yosry Ahmed
2024-01-11 16:50 ` Shakeel Butt
2024-01-11 17:59 ` Roman Gushchin
2024-01-11 19:28   ` Johannes Weiner
2024-01-11 19:38     ` Roman Gushchin
2024-01-11 19:49       ` Johannes Weiner
2024-01-12 17:06     ` Michal Hocko
2024-01-12 17:10       ` Roman Gushchin
2024-01-12 17:23         ` Michal Hocko [this message]
2024-01-12 19:04     ` Shakeel Butt
2024-01-12 20:59       ` Roman Gushchin
2024-01-12 21:27         ` Shakeel Butt

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=ZaF1oQyovAOMA3be@tiehlicka \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=schatzberg.dan@gmail.com \
    --cc=shakeelb@google.com \
    --cc=tj@kernel.org \
    /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