All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Zhaoyang Huang <huangzhaoyang@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>,
	"zhaoyang.huang" <zhaoyang.huang@unisoc.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	cgroups mailinglist <cgroups@vger.kernel.org>,
	Ke Wang <ke.wang@unisoc.com>
Subject: Re: [RFC PATCH] cgroup: introduce dynamic protection for memcg
Date: Thu, 7 Apr 2022 16:14:57 +0200	[thread overview]
Message-ID: <Yk7x4U5gTvS4/ijR@dhcp22.suse.cz> (raw)
In-Reply-To: <CAGWkznH1NhfDXy94cOs0YWnw_uOOVbcbrygT5X6CAZ44CTf78Q@mail.gmail.com>

On Thu 07-04-22 20:36:51, Zhaoyang Huang wrote:
> On Thu, Apr 7, 2022 at 5:44 PM Michal Hocko <mhocko@suse.com> wrote:
> >
> > [...]
> > On Thu 07-04-22 16:59:50, Zhaoyang Huang wrote:
> > > > This means that limits are altered even if there is memory to be
> > > > reclaimed from other memcgs. Why? How does this line up with the
> > > > basic property of the low limit to act as a protection from the reclaim?
> > > ok, partially understand. I would like to say that low's original
> > > definition under this patch has changed, says the calculated low just
> > > provide protection when the psi value is lower than the setting and
> > > will introduce reclaiming if it exceed.
> >
> > OK, I guess I finally get to understand what you are trying to say. So
> > effectivelly your new semantic defines the low limit as an initial
> > protection that is very soft and only preserved under a light global
> > memory pressure[1]. If the reclaim pressure is higher the user provided
> > protection is decreased. The new semantic is planned to be a global
> > opt-in.
> >
> > Correct?
> right. But I don't think the original protection is soft which could
> be proved by the test result that the memcg is protected in a certain
> range of pressure and could also help to release the system by
> breaking low limit.

Low limit protection is considered soft because it doesn't provide any
guarantee. I will be ignored (and that will be reported to the userspace
via LOW event) if there is nothing reclaimable in the scope of the
reclaimed hierarchy. An alternative would be OOM actually.

> > Now, that I (believe) to have a slightly better understanding I have to
> > say I really dislike the idea.
> > First of all the new semantic would have to be memcg reclaim aware. That
> > means that the scaling logic would need to be aware where the memory
> > pressure comes from.
> I don't follow. Does it mean that the protected should distinguish the
> pressure from global and other memcgs? I don't know why.

No, it should behave consistently for any external memory pressure.
A reclaimed memcg can apply different constraint depending on the root
of the reclaim. Your solution is considering root to be root_memcg.

[...]
-- 
Michal Hocko
SUSE Labs

WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
To: Zhaoyang Huang <huangzhaoyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Suren Baghdasaryan
	<surenb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	"zhaoyang.huang"
	<zhaoyang.huang-1tVvrHeaX6nQT0dZR+AlfA@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	Vladimir Davydov
	<vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"open list:MEMORY MANAGEMENT"
	<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	cgroups mailinglist
	<cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Ke Wang <ke.wang-1tVvrHeaX6nQT0dZR+AlfA@public.gmane.org>
Subject: Re: [RFC PATCH] cgroup: introduce dynamic protection for memcg
Date: Thu, 7 Apr 2022 16:14:57 +0200	[thread overview]
Message-ID: <Yk7x4U5gTvS4/ijR@dhcp22.suse.cz> (raw)
In-Reply-To: <CAGWkznH1NhfDXy94cOs0YWnw_uOOVbcbrygT5X6CAZ44CTf78Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu 07-04-22 20:36:51, Zhaoyang Huang wrote:
> On Thu, Apr 7, 2022 at 5:44 PM Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org> wrote:
> >
> > [...]
> > On Thu 07-04-22 16:59:50, Zhaoyang Huang wrote:
> > > > This means that limits are altered even if there is memory to be
> > > > reclaimed from other memcgs. Why? How does this line up with the
> > > > basic property of the low limit to act as a protection from the reclaim?
> > > ok, partially understand. I would like to say that low's original
> > > definition under this patch has changed, says the calculated low just
> > > provide protection when the psi value is lower than the setting and
> > > will introduce reclaiming if it exceed.
> >
> > OK, I guess I finally get to understand what you are trying to say. So
> > effectivelly your new semantic defines the low limit as an initial
> > protection that is very soft and only preserved under a light global
> > memory pressure[1]. If the reclaim pressure is higher the user provided
> > protection is decreased. The new semantic is planned to be a global
> > opt-in.
> >
> > Correct?
> right. But I don't think the original protection is soft which could
> be proved by the test result that the memcg is protected in a certain
> range of pressure and could also help to release the system by
> breaking low limit.

Low limit protection is considered soft because it doesn't provide any
guarantee. I will be ignored (and that will be reported to the userspace
via LOW event) if there is nothing reclaimable in the scope of the
reclaimed hierarchy. An alternative would be OOM actually.

> > Now, that I (believe) to have a slightly better understanding I have to
> > say I really dislike the idea.
> > First of all the new semantic would have to be memcg reclaim aware. That
> > means that the scaling logic would need to be aware where the memory
> > pressure comes from.
> I don't follow. Does it mean that the protected should distinguish the
> pressure from global and other memcgs? I don't know why.

No, it should behave consistently for any external memory pressure.
A reclaimed memcg can apply different constraint depending on the root
of the reclaim. Your solution is considering root to be root_memcg.

[...]
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2022-04-07 14:15 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31  8:00 [RFC PATCH] cgroup: introduce dynamic protection for memcg zhaoyang.huang
2022-03-31  8:00 ` zhaoyang.huang
2022-03-31  9:01 ` Michal Hocko
2022-03-31  9:01   ` Michal Hocko
2022-03-31 11:18   ` Zhaoyang Huang
2022-03-31 11:18     ` Zhaoyang Huang
2022-03-31 11:35     ` Michal Hocko
2022-03-31 11:35       ` Michal Hocko
2022-03-31 19:26       ` Suren Baghdasaryan
2022-03-31 19:26         ` Suren Baghdasaryan
2022-04-01  1:51         ` Zhaoyang Huang
2022-04-01  1:51           ` Zhaoyang Huang
2022-04-01  4:46           ` Suren Baghdasaryan
2022-04-01  4:46             ` Suren Baghdasaryan
2022-04-02  3:21             ` Zhaoyang Huang
2022-04-02  3:21               ` Zhaoyang Huang
2022-04-01  1:34       ` Zhaoyang Huang
2022-04-01  1:34         ` Zhaoyang Huang
2022-04-01 11:34         ` Michal Hocko
2022-04-01 11:34           ` Michal Hocko
2022-04-02  5:18           ` Zhaoyang Huang
2022-04-02  5:18             ` Zhaoyang Huang
2022-04-03 15:04             ` Suren Baghdasaryan
2022-04-03 15:04               ` Suren Baghdasaryan
2022-04-04  2:33               ` Zhaoyang Huang
2022-04-04  2:33                 ` Zhaoyang Huang
2022-04-04  8:51                 ` Michal Hocko
2022-04-04  8:51                   ` Michal Hocko
2022-04-04  9:07                   ` Zhaoyang Huang
2022-04-04  9:07                     ` Zhaoyang Huang
2022-04-04  9:23                     ` Zhaoyang Huang
2022-04-04  9:23                       ` Zhaoyang Huang
2022-04-04  9:32                       ` Michal Hocko
2022-04-04  9:32                         ` Michal Hocko
2022-04-04  9:36                         ` Michal Hocko
2022-04-04  9:36                           ` Michal Hocko
2022-04-04 11:35                           ` Zhaoyang Huang
2022-04-04 11:23                         ` Zhaoyang Huang
2022-04-04 11:23                           ` Zhaoyang Huang
2022-04-04 12:29                           ` Michal Hocko
2022-04-04 12:29                             ` Michal Hocko
2022-04-04 13:14                             ` Zhaoyang Huang
2022-04-04 13:14                               ` Zhaoyang Huang
2022-04-05 12:08                               ` Michal Hocko
2022-04-05 12:08                                 ` Michal Hocko
2022-04-06  2:11                                 ` Zhaoyang Huang
2022-04-06  2:11                                   ` Zhaoyang Huang
2022-04-07  7:40                                   ` Michal Hocko
2022-04-07  7:40                                     ` Michal Hocko
2022-04-07  8:59                                     ` Zhaoyang Huang
2022-04-07  9:44                                       ` Michal Hocko
2022-04-07  9:44                                         ` Michal Hocko
2022-04-07 12:36                                         ` Zhaoyang Huang
2022-04-07 12:36                                           ` Zhaoyang Huang
2022-04-07 14:14                                           ` Michal Hocko [this message]
2022-04-07 14:14                                             ` Michal Hocko
2022-04-06  8:21                                 ` Zhaoyang Huang
2022-04-06  8:21                                   ` Zhaoyang Huang

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=Yk7x4U5gTvS4/ijR@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=huangzhaoyang@gmail.com \
    --cc=ke.wang@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=surenb@google.com \
    --cc=vdavydov.dev@gmail.com \
    --cc=zhaoyang.huang@unisoc.com \
    /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.