linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Zhongkun He <hezhongkun.hzk@bytedance.com>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org,
	roman.gushchin@linux.dev, shakeel.butt@linux.dev,
	muchun.song@linux.dev, lizefan.x@bytedance.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	cgroups@vger.kernel.org
Subject: Re: [External] Re: [RFC PATCH 0/2] Add disable_unmap_file arg to memory.reclaim
Date: Thu, 29 Aug 2024 17:00:19 +0200	[thread overview]
Message-ID: <ZtCNA3iKd0_mH8Bf@tiehlicka> (raw)
In-Reply-To: <CACSyD1Ny8OFxZkVPaskpnTDXgWZLBNK04GwjynT2a0ahUwKcAw@mail.gmail.com>

On Thu 29-08-24 22:30:09, Zhongkun He wrote:
> On Thu, Aug 29, 2024 at 9:36 PM Michal Hocko <mhocko@suse.com> wrote:
[...]
> > Seeing this my main question is whether we should focus on swappiness
> > behavior more than adding a very strange and very targetted reclaim
> > mode. After all we have a mapped memory and executables protection in
> > place. So in the end this is more about balance between anon vs. file
> > LRUs.
> >
> 
> I  have a question about the swappiness, if set the swappiness=0, we can only
> reclaim the file pages. but we do not have an option to disable the reclaim from
> file pages because there are faster storages for the swap without IO, like zram
> and zswap.  I wonder if we can give it a try in this direction.

I do not think we should give any guarantee that 200 will only reclaim
anon pages. But having that heavily anon oriented makes sense and I
thought this was an existing semantic.

[...]
> > > The delay of the task becomes more serious because reading data will
> > > be slower.  Hot pages will thrash repeatedly between the memory and
> > > the disk.
> >
> > Doesn't refault stats and IO cost aspect of the reclaim when balancing
> > LRUs dealing with this situation already? Why it doesn't work in your
> > case? Have you tried to investigate that?
> 
> OK, I'll try to reproduce the problem again. but IIUC, we could not reclaim
> pages from one side. Please see this 'commit d483a5dd009  ("mm:
> vmscan: limit the range of LRU type balancing")'  [1]
> 
> Unless this condition is met:
> sc->file_is_tiny =
>             file + free <= total_high_wmark &&
>             !(sc->may_deactivate & DEACTIVATE_ANON) &&
>             anon >> sc->priority;

There have been some changes in this area where swappiness was treated
differently so it would make sense to investigate with the current mm
tree.

> [1]: https://lore.kernel.org/all/20200520232525.798933-15-hannes@cmpxchg.org/T/#u
> 
> > --
> > Michal Hocko
> > SUSE Labs

-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2024-08-29 15:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29 10:19 [RFC PATCH 0/2] Add disable_unmap_file arg to memory.reclaim Zhongkun He
2024-08-29 10:23 ` Michal Hocko
2024-08-29 10:37   ` [External] " Zhongkun He
2024-08-29 11:50     ` Michal Hocko
2024-08-29 13:15       ` Zhongkun He
2024-08-29 13:36         ` Michal Hocko
2024-08-29 14:30           ` Zhongkun He
2024-08-29 15:00             ` 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=ZtCNA3iKd0_mH8Bf@tiehlicka \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=hezhongkun.hzk@bytedance.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan.x@bytedance.com \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@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;
as well as URLs for NNTP newsgroup(s).