linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Chris Down <chris@chrisdown.name>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling
Date: Thu, 21 May 2020 19:37:01 +0200	[thread overview]
Message-ID: <20200521173701.GX6462@dhcp22.suse.cz> (raw)
In-Reply-To: <20200521163833.GA813446@cmpxchg.org>

On Thu 21-05-20 12:38:33, Johannes Weiner wrote:
> On Thu, May 21, 2020 at 04:35:15PM +0200, Michal Hocko wrote:
> > On Thu 21-05-20 09:51:52, Johannes Weiner wrote:
> > > On Thu, May 21, 2020 at 09:32:45AM +0200, Michal Hocko wrote:
> > [...]
> > > > I am not saying the looping over try_to_free_pages is wrong. I do care
> > > > about the final reclaim target. That shouldn't be arbitrary. We have
> > > > established a target which is proportional to the requested amount of
> > > > memory. And there is a good reason for that. If any task tries to
> > > > reclaim down to the high limit then this might lead to a large
> > > > unfairness when heavy producers piggy back on the active reclaimer(s).
> > > 
> > > Why is that different than any other form of reclaim?
> > 
> > Because the high limit reclaim is a best effort rather than must to
> > either get over reclaim watermarks and continue allocation or meet the
> > hard limit requirement to continue.
> 
> It's not best effort. It's a must-meet or get put to sleep. You are
> mistaken about what memory.high is.

I do not see anything like that being documented. Let me remind you what
the documentation says:
  memory.high
        A read-write single value file which exists on non-root
        cgroups.  The default is "max".

        Memory usage throttle limit.  This is the main mechanism to
        control memory usage of a cgroup.  If a cgroup's usage goes
        over the high boundary, the processes of the cgroup are
        throttled and put under heavy reclaim pressure.

        Going over the high limit never invokes the OOM killer and
        under extreme conditions the limit may be breached.

My understanding is that breaching the limit is acceptable if the memory
is not reclaimable after placing a heavy reclaim pressure. We can
discuss what the heavy reclaim means but the underlying fact is that the
keeping the consumption under the limit is a best effort.

Please also let me remind you that the best effort implementation has
been there since the beginning when the memory.high has been introduced.
Now you seem to be convinced that the semantic is _obviously_ different.

It is not the first time when the high limit behavior has changed.
Mostly based on "what is currently happening in your fleet". And can see
why it is reasonable to adopt to a real life usage. That is OK most of
the time. But I haven't heard why keeping the existing approach and
enforcing the reclaim target is not working properly so far. All I can
hear is a generic statement that consistency matters much more than all
potential problem it might introduce.

Anyway, I do see that you are not really willing to have a
non-confrontational discussion so I do not bother to reply to the rest
and participate in the further discussion.

As usual, let me remind you that I haven't nacked the patch. I do not
plan to do that because "this is not black&white" as already said. But
if your really want to push this through then let's do it properly at
least. memcg->memcg_nr_pages_over_high has only very vague meaning if
the reclaim target is the high limit. The changelog should be also
explicit about a potentially large stalls so that people debugging such
a problem have a clue at least.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2020-05-21 17:37 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 14:37 [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling Chris Down
2020-05-20 16:07 ` Michal Hocko
2020-05-20 16:51   ` Johannes Weiner
2020-05-20 17:04     ` Michal Hocko
2020-05-20 17:51       ` Johannes Weiner
2020-05-21  7:32         ` Michal Hocko
2020-05-21 13:51           ` Johannes Weiner
2020-05-21 14:22             ` Johannes Weiner
2020-05-21 14:35             ` Michal Hocko
2020-05-21 15:02               ` Chris Down
2020-05-21 16:38               ` Johannes Weiner
2020-05-21 17:37                 ` Michal Hocko [this message]
2020-05-21 18:45                   ` Johannes Weiner
2020-05-28 16:31                     ` Michal Hocko
2020-05-28 16:48                       ` Chris Down
2020-05-29  7:31                         ` Michal Hocko
2020-05-29 10:08                           ` Chris Down
2020-05-29 10:14                             ` Michal Hocko
2020-05-28 20:11                       ` Johannes Weiner
2020-05-20 20:26   ` Chris Down
2020-05-21  7:19     ` Michal Hocko
2020-05-21 11:27       ` Chris Down
2020-05-21 12:04         ` Michal Hocko
2020-05-21 12:23           ` Chris Down
2020-05-21 12:24             ` Chris Down
2020-05-21 12:37             ` Michal Hocko
2020-05-21 12:57               ` Chris Down
2020-05-21 13:05                 ` Chris Down
2020-05-21 13:28                   ` Michal Hocko
2020-05-21 13:21                 ` Michal Hocko
2020-05-21 13:41                   ` Chris Down
2020-05-21 13:58                     ` Michal Hocko
2020-05-21 14:22                       ` Chris Down
2020-05-21 12:28         ` Michal Hocko
2020-05-28 18:02 ` Shakeel Butt
2020-05-28 19:48   ` Chris Down
2020-05-28 20:29     ` Johannes Weiner
2020-05-28 21:02       ` Shakeel Butt
2020-05-28 21:14       ` Chris Down
2020-05-29  7:25       ` 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=20200521173701.GX6462@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=chris@chrisdown.name \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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).