Linux-mm Archive on
 help / color / Atom feed
From: Shakeel Butt <>
To: Johannes Weiner <>
Cc: Andrew Morton <>,
	Michal Hocko <>,  Roman Gushchin <>,
	Linux MM <>, Cgroups <>,
	 LKML <>,
	Kernel Team <>
Subject: Re: [PATCH] mm: memcontrol: don't count limit-setting reclaim as memory pressure
Date: Tue, 28 Jul 2020 08:03:56 -0700
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, Jul 28, 2020 at 6:53 AM Johannes Weiner <> wrote:
> When an outside process lowers one of the memory limits of a cgroup
> (or uses the force_empty knob in cgroup1), direct reclaim is performed
> in the context of the write(), in order to directly enforce the new
> limit and have it being met by the time the write() returns.
> Currently, this reclaim activity is accounted as memory pressure in
> the cgroup that the writer(!) belongs to. This is unexpected.

Indeed this is unexpected.

> It
> specifically causes problems for senpai
> (, which is an agent that
> routinely adjusts the memory limits and performs associated reclaim
> work in tens or even hundreds of cgroups running on the host. The
> cgroup that senpai is running in itself will report elevated levels of
> memory pressure, even though it itself is under no memory shortage or
> any sort of distress.
> Move the psi annotation from the central cgroup reclaim function to
> callsites in the allocation context, and thereby no longer count any
> limit-setting reclaim as memory pressure. If the newly set limit
> causes the workload inside the cgroup into direct reclaim, that of
> course will continue to count as memory pressure.
> Signed-off-by: Johannes Weiner <>

Reviewed-by: Shakeel Butt <>

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 13:52 Johannes Weiner
2020-07-28 15:03 ` Shakeel Butt [this message]
2020-07-28 18:53 ` Roman Gushchin
2020-07-28 19:44 ` Chris Down
2020-07-30 12:00 ` 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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \

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

Linux-mm Archive on

Archives are clonable:
	git clone --mirror linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ \
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone