linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Zhongkun He <hezhongkun.hzk@bytedance.com>,
	akpm@linux-foundation.org, muchun.song@linux.dev,
	yosry.ahmed@linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] mm: vmscan: skip the file folios in proactive reclaim if swappiness is MAX
Date: Fri, 14 Mar 2025 15:49:30 +0100	[thread overview]
Message-ID: <Z9RB-gHgtXRc86ro@tiehlicka> (raw)
In-Reply-To: <20250314141833.GA1316033@cmpxchg.org>

On Fri 14-03-25 10:18:33, Johannes Weiner wrote:
> On Fri, Mar 14, 2025 at 10:27:57AM +0100, Michal Hocko wrote:
[...]
> > I have just noticed that you have followed up [1] with a concern that
> > using swappiness in the whole min-max range without any heuristics turns
> > out to be harder than just relying on the min and max as extremes.
> > What seems to be still missing (or maybe it is just me not seeing that)
> > is why should we only enforce those extreme ends of the range and still
> > preserve under-defined semantic for all other swappiness values in the
> > pro-active reclaim.
> 
> I'm guess I'm not seeing the "under-defined" part.

What I meant here is that any other value than both ends of swappiness
doesn't have generally predictable behavior unless you know specific
details of the current memory reclaim heuristics in get_scan_count.

> cache_trim_mode is
> there to make sure a streaming file access pattern doesn't cause
> swapping.

Yes, I am aware of the purpose.

> He has a special usecase to override cache_trim_mode when he
> knows a large amount of anon is going cold. There is no way we can
> generally remove it from proactive reclaim.

I believe I do understand the requirement here. The patch offers
counterpart to noswap pro-active reclaim and I do not have objections to
that.

The reason I brought this up is that everything in between 0..200 is
kinda gray area. We've had several queries why swappiness=N doesn't work
as expected and the usual answer was because of heuristics. Most people
just learned to live with that and stopped fine tuning vm_swappiness.
Which is good I guess.

Pro-active reclaim is slightly different in a sense that it gives a much
better control on how much to reclaim and since we have addes swappiness
extension then even the balancing. So why not make that balancing work
for real and always follow the given proportion? To prevent any
unintended regressions this would be the case only with swappiness was
explicitly given to the reclaim request. Does that make any sense?
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2025-03-14 14:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14  3:33 Zhongkun He
2025-03-14  6:11 ` Muchun Song
2025-03-14  8:52 ` Michal Hocko
2025-03-14  9:24   ` [External] " Zhongkun He
2025-03-14  9:27   ` Michal Hocko
2025-03-14 10:35     ` [External] " Zhongkun He
2025-03-14 14:18     ` Johannes Weiner
2025-03-14 14:49       ` Michal Hocko [this message]
2025-03-14 16:57         ` Johannes Weiner
2025-03-14 17:52           ` Yosry Ahmed
2025-03-14 11:32 ` Hailong Liu

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=Z9RB-gHgtXRc86ro@tiehlicka \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=hezhongkun.hzk@bytedance.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=yosry.ahmed@linux.dev \
    /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