From: Johannes Weiner <hannes@cmpxchg.org>
To: "T.J. Mercier" <tjmercier@google.com>
Cc: Michal Hocko <mhocko@suse.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeelb@google.com>,
Muchun Song <muchun.song@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
android-mm@google.com, yuzhao@google.com,
yangyifei03@kuaishou.com, cgroups@vger.kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Revert "mm:vmscan: fix inaccurate reclaim during proactive reclaim"
Date: Fri, 26 Jan 2024 11:34:01 -0500 [thread overview]
Message-ID: <20240126163401.GJ1567330@cmpxchg.org> (raw)
In-Reply-To: <CABdmKX1uDsnFSG2YCyToZHD2R+A9Vr=SKeLgSqPocUgWd16+XA@mail.gmail.com>
On Wed, Jan 24, 2024 at 09:46:23AM -0800, T.J. Mercier wrote:
> In the meantime, instead of a revert how about changing the batch size
> geometrically instead of the SWAP_CLUSTER_MAX constant:
>
> reclaimed = try_to_free_mem_cgroup_pages(memcg,
> - min(nr_to_reclaim -
> nr_reclaimed, SWAP_CLUSTER_MAX),
> + (nr_to_reclaim - nr_reclaimed)/2,
> GFP_KERNEL, reclaim_options);
>
> I think that should address the overreclaim concern (it was mentioned
> that the upper bound of overreclaim was 2 * request), and this should
> also increase the reclaim rate for root reclaim with MGLRU closer to
> what it was before.
Hahaha. Would /4 work for you?
I genuinely think the idea is worth a shot. /4 would give us a bit
more margin for error, since the bailout/fairness cutoffs have changed
back and forth over time. And it should still give you a reasonable
convergence on MGLRU.
try_to_free_reclaim_pages() already does max(nr_to_reclaim,
SWAP_CLUSTER_MAX) which will avoid the painful final approach loops
the integer division would produce on its own.
Please add a comment mentioning the compromise between the two reclaim
implementations though.
next prev parent reply other threads:[~2024-01-26 16:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-21 21:44 T.J. Mercier
2024-01-23 2:24 ` Yu Zhao
2024-01-23 9:33 ` Michal Hocko
2024-01-23 13:58 ` T.J. Mercier
2024-01-23 16:19 ` Michal Hocko
2024-01-24 17:14 ` T.J. Mercier
2024-01-23 16:48 ` Johannes Weiner
2024-01-24 7:50 ` Michal Hocko
2024-01-24 17:46 ` T.J. Mercier
2024-01-26 16:34 ` Johannes Weiner [this message]
2024-01-26 16:41 ` T.J. Mercier
2024-01-30 20:58 ` T.J. Mercier
2024-01-30 21:56 ` Johannes Weiner
2024-01-27 6:17 ` Yu Zhao
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=20240126163401.GJ1567330@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=android-mm@google.com \
--cc=cgroups@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@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=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