From: Johannes Weiner <hannes@cmpxchg.org>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: "T.J. Mercier" <tjmercier@google.com>,
Michal Hocko <mhocko@kernel.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,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm: memcg: Use larger batches for proactive reclaim
Date: Fri, 2 Feb 2024 17:41:17 -0500 [thread overview]
Message-ID: <20240202224117.GA341862@cmpxchg.org> (raw)
In-Reply-To: <CAJD7tkZh=M58Avfwx_D+UEXy6mm18Zx_hVKn8Gb8-+8-JQQfWw@mail.gmail.com>
On Fri, Feb 02, 2024 at 02:13:20PM -0800, Yosry Ahmed wrote:
> On Fri, Feb 2, 2024 at 2:10 PM T.J. Mercier <tjmercier@google.com> wrote:
> > @@ -6965,6 +6965,9 @@ static ssize_t memory_reclaim(struct kernfs_open_file *of, char *buf,
> > while (nr_reclaimed < nr_to_reclaim) {
> > unsigned long reclaimed;
> >
> > + /* Will converge on zero, but reclaim enforces a minimum */
> > + unsigned long batch_size = (nr_to_reclaim - nr_reclaimed) / 4;
> > +
> > if (signal_pending(current))
> > return -EINTR;
> >
> > @@ -6977,7 +6980,7 @@ static ssize_t memory_reclaim(struct kernfs_open_file *of, char *buf,
> > lru_add_drain_all();
> >
> > reclaimed = try_to_free_mem_cgroup_pages(memcg,
> > - min(nr_to_reclaim - nr_reclaimed, SWAP_CLUSTER_MAX),
> > + batch_size,
> > GFP_KERNEL, reclaim_options);
>
> I think the above two lines should now fit into one.
Yeah might as well compact that again. The newline in the declarations
is a bit unusual for this codebase as well, and puts the comment sort
of away from the "reclaim" it refers to. This?
/* Will converge on zero, but reclaim enforces a minimum */
batch_size = (nr_to_reclaim - nr_reclaimed) / 4;
reclaimed = try_to_free_mem_cgroup_pages(memcg, batch_size,
GFP_KERNEL, reclaim_options);
But agreed, it's all just nitpickety nickpicking. :)
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
next prev parent reply other threads:[~2024-02-02 22:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 22:10 T.J. Mercier
2024-02-02 22:13 ` Yosry Ahmed
2024-02-02 22:29 ` T.J. Mercier
2024-02-02 22:35 ` Yosry Ahmed
2024-02-02 22:41 ` Johannes Weiner [this message]
2024-02-02 22:51 ` T.J. Mercier
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=20240202224117.GA341862@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@kernel.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