LKML Archive on
help / color / mirror / Atom feed
From: Rik van Riel <>
To: "" <>,
	"" <>
Cc: Kernel Team <>,
	"" <>,
	"" <>,
	"" <>,
	"" <>
Subject: Re: [PATCH] mm: memcontrol: fix blocking rstat function called from atomic cgroup1 thresholding code
Date: Mon, 26 Jul 2021 15:16:06 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, 2021-07-26 at 11:00 -0400, Johannes Weiner wrote:
> __mem_cgroup_threshold() indeed holds the rcu lock. In addition, the
> thresholding code is invoked during stat changes, and those contexts
> have irqs disabled as well. If the lock breaking occurs inside the
> flush function, it will result in a sleep from an atomic context.
> Use the irsafe flushing variant in mem_cgroup_usage() to fix this

While this fix is necessary, in the long term I think we may
want some sort of redesign here, to make sure the irq safe
version does not spin long times trying to get the statistics
off some other CPU.

I have seen a number of soft (IIRC) lockups deep inside the
bowels of cgroup_rstat_flush_irqsafe, with the function taking
multiple seconds to complete.

Reviewed-by: Rik van Riel <>

  parent reply	other threads:[~2021-07-26 15:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 15:00 Johannes Weiner
2021-07-26 15:08 ` Chris Down
2021-07-26 15:16 ` Rik van Riel [this message]
2021-07-27 16:51   ` Shakeel Butt
2021-08-03 14:34     ` Rik van Riel
2021-07-26 20:32 ` Michal Hocko
2021-07-27 16:59 ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] mm: memcontrol: fix blocking rstat function called from atomic cgroup1 thresholding code' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).