From: Shakeel Butt <shakeelb@google.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linux MM <linux-mm@kvack.org>, Kernel Team <kernel-team@fb.com>,
Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
Chris Down <chris@chrisdown.name>,
Cgroups <cgroups@vger.kernel.org>,
Michal Hocko <mhocko@kernel.org>
Subject: Re: [PATCH mm v4 3/4] mm: move cgroup high memory limit setting into struct page_counter
Date: Tue, 19 May 2020 15:15:41 -0700 [thread overview]
Message-ID: <CALvZod4i2sBWcbKe3MHMuSMV3ywWwQx1Xr-abEqPS6n8vioC7w@mail.gmail.com> (raw)
In-Reply-To: <20200519171938.3569605-4-kuba@kernel.org>
On Tue, May 19, 2020 at 10:19 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> High memory limit is currently recorded directly in
> struct mem_cgroup. We are about to add a high limit
> for swap, move the field to struct page_counter and
> add some helpers.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
> --- a/include/linux/page_counter.h
> +++ b/include/linux/page_counter.h
...
[snip]
...
>
> +static inline bool page_counter_is_above_high(struct page_counter *counter)
> +{
> + return page_counter_read(counter) > READ_ONCE(counter->high);
> +}
> +
...
[snip]
...
> --- a/mm/page_counter.c
> +++ b/mm/page_counter.c
> @@ -198,6 +198,11 @@ int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages)
> }
> }
>
> +void page_counter_set_high(struct page_counter *counter, unsigned long nr_pages)
> +{
> + WRITE_ONCE(counter->high, nr_pages);
> +}
> +
Any reason not to make this static inline like
page_counter_is_above_high() and in page_counter.h?
next prev parent reply other threads:[~2020-05-19 22:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 17:19 [PATCH mm v4 0/4] memcg: Slow down swap allocation as the available space gets depleted Jakub Kicinski
2020-05-19 17:19 ` [PATCH mm v4 1/4] mm: prepare for swap over-high accounting and penalty calculation Jakub Kicinski
2020-05-20 1:38 ` Shakeel Butt
2020-05-19 17:19 ` [PATCH mm v4 2/4] mm: move penalty delay clamping out of calculate_high_delay() Jakub Kicinski
2020-05-20 1:40 ` Shakeel Butt
2020-05-19 17:19 ` [PATCH mm v4 3/4] mm: move cgroup high memory limit setting into struct page_counter Jakub Kicinski
2020-05-19 22:15 ` Shakeel Butt [this message]
2020-05-19 23:14 ` Jakub Kicinski
2020-05-20 0:21 ` Shakeel Butt
2020-05-19 17:19 ` [PATCH mm v4 4/4] mm: automatically penalize tasks with high swap use Jakub Kicinski
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=CALvZod4i2sBWcbKe3MHMuSMV3ywWwQx1Xr-abEqPS6n8vioC7w@mail.gmail.com \
--to=shakeelb@google.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=chris@chrisdown.name \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@fb.com \
--cc=kuba@kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).