cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: "T.J. Mercier" <tjmercier@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Shakeel Butt <shakeelb@google.com>,
	Muchun Song <muchun.song@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	Efly Young <yangyifei03@kuaishou.com>,
	android-mm@google.com, yuzhao@google.com, mkoutny@suse.com,
	Yosry Ahmed <yosryahmed@google.com>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] mm: memcg: Use larger batches for proactive reclaim
Date: Mon, 19 Feb 2024 20:33:17 +0100	[thread overview]
Message-ID: <ZdOs_fCxrFCbjnr0@tiehlicka> (raw)
In-Reply-To: <CABdmKX0-nWU4P7ZJqOMusRCuhewf+kg1x==U7m52=MaKeRCYWg@mail.gmail.com>

On Mon 19-02-24 08:39:19, T.J. Mercier wrote:
> On Mon, Feb 19, 2024 at 4:11 AM Michal Hocko <mhocko@suse.com> wrote:
> >
> > On Tue 06-02-24 09:58:41, Michal Hocko wrote:
> > > On Mon 05-02-24 20:01:40, T.J. Mercier wrote:
> > > > On Mon, Feb 5, 2024 at 1:16 PM Michal Hocko <mhocko@suse.com> wrote:
> > > > >
> > > > > On Mon 05-02-24 12:47:47, T.J. Mercier wrote:
> > > > > > On Mon, Feb 5, 2024 at 12:36 PM Michal Hocko <mhocko@suse.com> wrote:
> > > > > [...]
> > > > > > > This of something like
> > > > > > > timeout $TIMEOUT echo $TARGET > $MEMCG_PATH/memory.reclaim
> > > > > > > where timeout acts as a stop gap if the reclaim cannot finish in
> > > > > > > TIMEOUT.
> > > > > >
> > > > > > Yeah I get the desired behavior, but using sc->nr_reclaimed to achieve
> > > > > > it is what's bothering me.
> > > > >
> > > > > I am not really happy about this subtlety. If we have a better way then
> > > > > let's do it. Better in its own patch, though.
> > > > >
> > > > > > It's already wired up that way though, so if you want to make this
> > > > > > change now then I can try to test for the difference using really
> > > > > > large reclaim targets.
> > > > >
> > > > > Yes, please. If you want it a separate patch then no objection from me
> > > > > of course. If you do no like the nr_to_reclaim bailout then maybe we can
> > > > > go with a simple break out flag in scan_control.
> > > > >
> > > > > Thanks!
> > > >
> > > > It's a bit difficult to test under the too_many_isolated check, so I
> > > > moved the fatal_signal_pending check outside and tried with that.
> > > > Performing full reclaim on the /uid_0 cgroup with a 250ms delay before
> > > > SIGKILL, I got an average of 16ms better latency with
> > > > sc->nr_to_reclaim across 20 runs ignoring one 1s outlier with
> > > > SWAP_CLUSTER_MAX.
> > >
> > > This will obviously scale with the number of memcgs in the hierarchy but
> > > you are right that too_many_isolated makes the whole fatal_signal_pending
> > > check rather inefficient. I haven't missed that. The reclaim path is
> > > rather convoluted so this will likely be more complex than I
> > > anticipated. I will think about that some more.
> > >
> > > In order to not delay your patch, please repost with suggested updates
> > > to the changelog. This needs addressing IMO but I do not think this is
> > > critical at this stage.
> >
> > Has there been a new version or a proposal to refine the changelog
> > posted?
> 
> Hi Michal,
> 
> I updated the commit message in V4 to include a sentence about restart
> cost, and added a line above each reclaim test to note the MGLRU
> config and whether the memcg LRU was used or not.
> 
> https://lore.kernel.org/all/20240206175251.3364296-1-tjmercier@google.com/

Hmm, missed that one for some reason.

-- 
Michal Hocko
SUSE Labs

      reply	other threads:[~2024-02-19 19:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 23:38 [PATCH v3] mm: memcg: Use larger batches for proactive reclaim T.J. Mercier
2024-02-04 16:17 ` Shakeel Butt
2024-02-05 10:01 ` Michal Koutný
2024-02-05 10:40 ` Michal Hocko
2024-02-05 19:29   ` T.J. Mercier
2024-02-05 19:40     ` Michal Hocko
2024-02-05 20:26       ` T.J. Mercier
2024-02-05 20:36         ` Michal Hocko
2024-02-05 20:47           ` T.J. Mercier
2024-02-05 21:16             ` Michal Hocko
2024-02-06  4:01               ` T.J. Mercier
2024-02-06  8:58                 ` Michal Hocko
2024-02-19 12:11                   ` Michal Hocko
2024-02-19 16:39                     ` T.J. Mercier
2024-02-19 19:33                       ` Michal Hocko [this message]

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=ZdOs_fCxrFCbjnr0@tiehlicka \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=android-mm@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mkoutny@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeelb@google.com \
    --cc=tjmercier@google.com \
    --cc=yangyifei03@kuaishou.com \
    --cc=yosryahmed@google.com \
    --cc=yuzhao@google.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).