All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhaoyang Huang <huangzhaoyang@gmail.com>
To: Michal Hocko <mhocko@suse.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:59:50 +0800	[thread overview]
Message-ID: <CAGWkznG+V88f_DjtJAe4_Nr=32Q7Z4b1CaBCB0FVqhAAsuNsWA@mail.gmail.com> (raw)
In-Reply-To: <Yk6VZlGnB48RqnYW@dhcp22.suse.cz>

On Thu, Apr 7, 2022 at 3:40 PM Michal Hocko <mhocko@suse.com> wrote:
>
> On Wed 06-04-22 10:11:19, Zhaoyang Huang wrote:
> > On Tue, Apr 5, 2022 at 8:08 PM Michal Hocko <mhocko@suse.com> wrote:
> > >
> > > On Mon 04-04-22 21:14:40, Zhaoyang Huang wrote:
> > > [...]
> > > > Please be noticed that this patch DOES protect the memcg when external
> > > > pressure is 1GB as fixed low does.
> > >
> > > This is getting more and more confusing (at least to me). Could you
> > > describe the behavior of the reclaim for the following setups/situations?
> > >
> > > a) mostly reclaiming a clean page cache - via kswapd
> > > b) same as above but the direct reclaim is necessary but very
> > >    lightweight
> > > c) direct reclaim makes fwd progress but not enough to satisfy the
> > >    allocation request (so the reclaim has to be retried)
> > > d) direct reclaim not making progress and low limit protection is
> > >    ignored.
> > >
> > > Say we have several memcgs and only some have low memory protection
> > > configured. What is the user observable state of the protected group and
> > > when and how much the protection can be updated?
> > I am not sure if I understand you right. Do you have suspicions on the
> > test result as you think protected memcg has no chance to update the
> > protection or the global reclaim should have been satisfied with the
> > reclaiming(step d is hard to reach?). Let me try to answer it under my
> > understanding, please give me feedback if you need more info. The
> > protection is updated while mem_cgroup_calculate_protection is called
> > during either kswapd or direct reclaim for each round of the priority
> > reclaiming and then the memcg's lruvec will be reached in step d.
>
> 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. It also can be seen from the
bellowing latest test result(same as previous test but without mlock),
which says that the memcg with fixed low will push back the reclaim to
global LRU while keeping psi to be high. Please be noticed that the
low will be updated when usage raise up over it which means resume the
protection again when the memcg become active.

                          psi(global=1GB)        max      stable
  psi(global=2GB)     max      stable
Low=400MB      some=18 full=11       700MB 600MB       some=20 full=16
    400MB 400MB
Low=500MB      some=18 full=13       680MB 540MB       some=27 full=17
    500MB 500MB
patch setting1    some=19 full=13       863MB 740MB       some=15
full=10     500MB 500MB
patch setting1    some=14 full=11       640MB 470MB       some=20
full=12     360MB 320MB

>
> > > I think it would be also helpful to describe the high level semantic of
> > > this feature.
>
> Please focus on this part. Without a high level semantic explained we
> will not move forward.
> --
> Michal Hocko
> SUSE Labs

  reply	other threads:[~2022-04-07  9:01 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 [this message]
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
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='CAGWkznG+V88f_DjtJAe4_Nr=32Q7Z4b1CaBCB0FVqhAAsuNsWA@mail.gmail.com' \
    --to=huangzhaoyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=ke.wang@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --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.