linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Koutný" <mkoutny@suse.com>
To: "T.J. Mercier" <tjmercier@google.com>
Cc: Efly Young <yangyifei03@kuaishou.com>,
	hannes@cmpxchg.org,  akpm@linux-foundation.org,
	android-mm@google.com, cgroups@vger.kernel.org,
	 linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	mhocko@kernel.org, muchun.song@linux.dev,
	 roman.gushchin@linux.dev, shakeelb@google.com,
	yuzhao@google.com
Subject: Re: Re: Re: [PATCH] mm: memcg: Use larger chunks for proactive reclaim
Date: Fri, 2 Feb 2024 20:46:56 +0100	[thread overview]
Message-ID: <bycpbzvo2fpd2qrrl7ipnzrsyun7hg5tjlqouafuosxxlxfml5@vpbl6kl74hx5> (raw)
In-Reply-To: <CABdmKX2KsxVExVWzysc_fQagGkYWhqRF00KxNxjpVWovHHip+Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

On Fri, Feb 02, 2024 at 10:22:34AM -0800, "T.J. Mercier" <tjmercier@google.com> wrote:
> So all of these should be more or less equivalent:
> delta <= SWAP_CLUSTER_MAX ? delta : (delta + 3*SWAP_CLUSTER_MAX) / 4
> max((nr_to_reclaim - nr_reclaimed) / 4, (nr_to_reclaim - nr_reclaimed) % 4)
> (nr_to_reclaim - nr_reclaimed) / 4 + 4
> (nr_to_reclaim - nr_reclaimed) / 4
> 
> I was just trying to avoid putting in a 0 for the request size with the mod.

The third variant would be simpler then. Modulo looks weird.

Oh, and I just realized that try_to_free_mem_cgroup_pages() does
max(nr_pages, SWAP_CLUSTER_MAX). Then I'd vote for the fourth variant +
possible comment about harmless 0.
(I'm sorry if this was discussed before.)

Michal

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 16:24 T.J. Mercier
2024-01-31 17:50 ` Johannes Weiner
2024-01-31 18:01   ` T.J. Mercier
2024-01-31 20:12     ` Johannes Weiner
2024-02-01 13:57 ` Michal Koutný
2024-02-01 15:34   ` Johannes Weiner
2024-02-01 18:10     ` T.J. Mercier
2024-02-02  5:02     ` Efly Young
2024-02-02 10:15       ` Michal Koutný
2024-02-02 18:22         ` T.J. Mercier
2024-02-02 19:46           ` Michal Koutný [this message]
2024-02-02 21:42             ` 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=bycpbzvo2fpd2qrrl7ipnzrsyun7hg5tjlqouafuosxxlxfml5@vpbl6kl74hx5 \
    --to=mkoutny@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=mhocko@kernel.org \
    --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