From: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Chris Down <chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
Cc: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kernel-team-b10kYP2dOMg@public.gmane.org
Subject: Re: [PATCH] mm, memcg: unify reclaim retry limits with page allocator
Date: Wed, 20 May 2020 16:40:37 -0700 [thread overview]
Message-ID: <20200520164037.e3598bc902e39415f4c263e7@linux-foundation.org> (raw)
In-Reply-To: <20200520163142.GA808793-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
On Wed, 20 May 2020 17:31:42 +0100 Chris Down <chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org> wrote:
> Reclaim retries have been set to 5 since the beginning of time in
> 66e1707bc346 ("Memory controller: add per cgroup LRU and reclaim").
> However, we now have a generally agreed-upon standard for page reclaim:
> MAX_RECLAIM_RETRIES (currently 16), added many years later in
> 0a0337e0d1d1 ("mm, oom: rework oom detection").
>
> In the absence of a compelling reason to declare an OOM earlier in memcg
> context than page allocator context, it seems reasonable to supplant
> MEM_CGROUP_RECLAIM_RETRIES with MAX_RECLAIM_RETRIES, making the page
> allocator and memcg internals more similar in semantics when reclaim
> fails to produce results, avoiding premature OOMs or throttling.
>
> ...
>
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -73,9 +73,6 @@ EXPORT_SYMBOL(memory_cgrp_subsys);
>
> struct mem_cgroup *root_mem_cgroup __read_mostly;
>
> -/* The number of times we should retry reclaim failures before giving up. */
hm, what tree is this against?
> -#define MEM_CGROUP_RECLAIM_RETRIES 5
> -
> /* Socket memory accounting disabled? */
> static bool cgroup_memory_nosocket;
>
> @@ -2386,7 +2383,7 @@ void mem_cgroup_handle_over_high(void)
> unsigned long pflags;
> unsigned long nr_reclaimed;
> unsigned int nr_pages = current->memcg_nr_pages_over_high;
> - int nr_retries = MEM_CGROUP_RECLAIM_RETRIES;
> + int nr_retries = MAX_RECLAIM_RETRIES;
I can't seem to find a tree in which mem_cgroup_handle_over_high() has
a local `nr_retries'.
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Chris Down <chris@chrisdown.name>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] mm, memcg: unify reclaim retry limits with page allocator
Date: Wed, 20 May 2020 16:40:37 -0700 [thread overview]
Message-ID: <20200520164037.e3598bc902e39415f4c263e7@linux-foundation.org> (raw)
In-Reply-To: <20200520163142.GA808793@chrisdown.name>
On Wed, 20 May 2020 17:31:42 +0100 Chris Down <chris@chrisdown.name> wrote:
> Reclaim retries have been set to 5 since the beginning of time in
> 66e1707bc346 ("Memory controller: add per cgroup LRU and reclaim").
> However, we now have a generally agreed-upon standard for page reclaim:
> MAX_RECLAIM_RETRIES (currently 16), added many years later in
> 0a0337e0d1d1 ("mm, oom: rework oom detection").
>
> In the absence of a compelling reason to declare an OOM earlier in memcg
> context than page allocator context, it seems reasonable to supplant
> MEM_CGROUP_RECLAIM_RETRIES with MAX_RECLAIM_RETRIES, making the page
> allocator and memcg internals more similar in semantics when reclaim
> fails to produce results, avoiding premature OOMs or throttling.
>
> ...
>
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -73,9 +73,6 @@ EXPORT_SYMBOL(memory_cgrp_subsys);
>
> struct mem_cgroup *root_mem_cgroup __read_mostly;
>
> -/* The number of times we should retry reclaim failures before giving up. */
hm, what tree is this against?
> -#define MEM_CGROUP_RECLAIM_RETRIES 5
> -
> /* Socket memory accounting disabled? */
> static bool cgroup_memory_nosocket;
>
> @@ -2386,7 +2383,7 @@ void mem_cgroup_handle_over_high(void)
> unsigned long pflags;
> unsigned long nr_reclaimed;
> unsigned int nr_pages = current->memcg_nr_pages_over_high;
> - int nr_retries = MEM_CGROUP_RECLAIM_RETRIES;
> + int nr_retries = MAX_RECLAIM_RETRIES;
I can't seem to find a tree in which mem_cgroup_handle_over_high() has
a local `nr_retries'.
next prev parent reply other threads:[~2020-05-20 23:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 16:31 [PATCH] mm, memcg: unify reclaim retry limits with page allocator Chris Down
2020-05-20 16:59 ` Michal Hocko
[not found] ` <20200520163142.GA808793-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
2020-05-20 23:40 ` Andrew Morton [this message]
2020-05-20 23:40 ` Andrew Morton
2020-05-20 23:42 ` Andrew Morton
[not found] ` <20200520164243.56133fa135f65cc708e70ec0-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2020-05-20 23:49 ` Chris Down
2020-05-20 23:49 ` Chris Down
2020-05-22 14:07 ` 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=20200520164037.e3598bc902e39415f4c263e7@linux-foundation.org \
--to=akpm-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=kernel-team-b10kYP2dOMg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.