From: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
To: Chris Down <chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
Cc: Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Roman Gushchin <guro-b10kYP2dOMg@public.gmane.org>,
Yafang Shao <laoar.shao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] mm, memcg: Decouple e{low,min} state mutations from protection checks
Date: Tue, 28 Apr 2020 17:19:53 -0400 [thread overview]
Message-ID: <20200428211953.GB400178@cmpxchg.org> (raw)
In-Reply-To: <51ffacb736bb02ecc09c828ebe8f4ec7fda68c48.1588092152.git.chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
On Tue, Apr 28, 2020 at 07:27:00PM +0100, Chris Down wrote:
> mem_cgroup_protected currently is both used to set effective low and min
> and return a mem_cgroup_protection based on the result. As a user, this
> can be a little unexpected: it appears to be a simple predicate
> function, if not for the big warning in the comment above about the
> order in which it must be executed.
>
> This change makes it so that we separate the state mutations from the
> actual protection checks, which makes it more obvious where we need to
> be careful mutating internal state, and where we are simply checking and
> don't need to worry about that.
>
> Signed-off-by: Chris Down <chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
> Suggested-by: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
> Cc: Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Roman Gushchin <guro-b10kYP2dOMg@public.gmane.org>
> Cc: Yafang Shao <laoar.shao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
next prev parent reply other threads:[~2020-04-28 21:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 18:26 [PATCH 0/2] mm: memcontrol: memory.{low,min} reclaim fix & cleanup Chris Down
[not found] ` <cover.1588092152.git.chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
2020-04-28 18:26 ` [PATCH 1/2] mm, memcg: Avoid stale protection values when cgroup is above protection Chris Down
2020-04-28 21:16 ` Johannes Weiner
[not found] ` <d454fca5d6b38b74d8dc35141e8519b02089a698.1588092152.git.chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
2020-04-29 10:15 ` Michal Hocko
2020-04-29 10:53 ` Yafang Shao
[not found] ` <CALOAHbAosoU=+iPgD+TeU_iDXTV7W_WcFdKCi2fdwwyvutG2zQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-04-29 14:19 ` Johannes Weiner
[not found] ` <20200429101510.GA28637-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2020-04-29 14:03 ` Johannes Weiner
[not found] ` <20200429140330.GA5054-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2020-04-29 14:17 ` Yafang Shao
2020-04-29 14:27 ` Johannes Weiner
2020-04-29 14:31 ` Yafang Shao
2020-04-29 15:04 ` Michal Hocko
[not found] ` <20200429150414.GI28637-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2020-04-29 16:56 ` Johannes Weiner
[not found] ` <20200429165627.GA24768-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2020-04-30 14:57 ` Michal Hocko
2020-04-30 17:17 ` Roman Gushchin
[not found] ` <20200430145721.GF12655-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2020-04-30 23:59 ` Yafang Shao
2020-05-04 7:23 ` Michal Hocko
[not found] ` <20200504072342.GD22838-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2020-05-04 22:59 ` Roman Gushchin
2020-04-30 1:04 ` Yafang Shao
2020-04-30 1:16 ` Chris Down
2020-04-30 1:31 ` Yafang Shao
2020-04-30 1:46 ` Chris Down
[not found] ` <20200430014603.GB2754277-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
2020-04-30 1:49 ` Yafang Shao
2020-04-28 18:27 ` [PATCH 2/2] mm, memcg: Decouple e{low,min} state mutations from protection checks Chris Down
[not found] ` <51ffacb736bb02ecc09c828ebe8f4ec7fda68c48.1588092152.git.chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
2020-04-28 21:19 ` Johannes Weiner [this message]
2020-04-29 10:06 ` 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=20200428211953.GB400178@cmpxchg.org \
--to=hannes-druugvl0lcnafugrpc6u6w@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org \
--cc=guro-b10kYP2dOMg@public.gmane.org \
--cc=laoar.shao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).