linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: Jianlin Lv <iecedge@gmail.com>,
	tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org,
	corbet@lwn.net, roman.gushchin@linux.dev, shakeelb@google.com,
	muchun.song@linux.dev, akpm@linux-foundation.org,
	yosryahmed@google.com, willy@infradead.org, linmiaohe@huawei.com,
	wangkefeng.wang@huawei.com, laoar.shao@gmail.com,
	yuzhao@google.com, wuyun.abel@bytedance.com, david@redhat.com,
	peterx@redhat.com, vishal.moola@gmail.com, hughd@google.com,
	cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	jianlv@ebay.com
Subject: Re: [PATCH] memcg: add interface to force disable swap
Date: Mon, 9 Oct 2023 09:34:30 +0200	[thread overview]
Message-ID: <ZSOtBsigRV4RGNXn@dhcp22.suse.cz> (raw)
In-Reply-To: <87edi4jq19.fsf@yhuang6-desk2.ccr.corp.intel.com>

On Mon 09-10-23 13:58:10, Huang, Ying wrote:
> Jianlin Lv <iecedge@gmail.com> writes:
> 
> > On Sun, Oct 8, 2023 at 4:26 PM Huang, Ying <ying.huang@intel.com> wrote:
> >>
> >> Jianlin Lv <iecedge@gmail.com> writes:
> >>
> >> > On Sun, Oct 8, 2023 at 9:17 AM Huang, Ying <ying.huang@intel.com> wrote:
> >> >>
> >> >> Jianlin Lv <iecedge@gmail.com> writes:
> >> >>
> >> >> > From: Jianlin Lv <iecedge@gmail.com>
> >> >> >
> >> >> > Global reclaim will swap even if swappiness is set to 0.
> >> >>
> >> >> Why?  Can you elaborate the situation?
> >> >
> >> > We reproduced the issue of pages being swapped out even when swappiness is
> >> > set to 0 in the production environment through the following test program.
> >> > Not sure whether this program can reproduce the issue in any environment.
> >> >
> >> > From the implementation of the get_scan_count code, it can be seen that,
> >> > based on the current runtime situation, memory reclamation will choose a
> >> > scanning method (SCAN_ANON/SCAN_FILE/SCAN_FRACT) to determine how
> >> > aggressively the anon and file LRU are scanned. However, this introduces
> >> > uncertainty.
> >> >
> >> > For the JVM issue at hand, we expect deterministic SCAN_FILE scan to avoid
> >> > swapping out anon pages.
> >>
> >> Why doesn't memory.swap.max work?
> >
> > The main reason is that deployed nodes  are kept on cgroups v1.

Please note that cgroups v1 is in the maintenance mode with no new
functionality to be added. What is the reason you are sticking with v1?

> Check the code again.  IIUC, for swappiness == 0, anonymous pages will
> only be reclaimed if sc->file_is_tiny is true.

For the memcg reclaim (i.e. not the global one) we try to avoid swapping
even when file_is_tiny IIRC.

> If we don't swap in that
> situation, OOM may be triggerred.  I don't think that it's a good idea
> to do that.  Or I miss something?

Or even worse the system might start trashing heavily over that
remaining tiny page cache.

-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2023-10-09  7:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-07 13:09 Jianlin Lv
2023-10-08  1:14 ` Huang, Ying
2023-10-08  7:52   ` Jianlin Lv
2023-10-08  8:24     ` Huang, Ying
2023-10-08  9:34       ` Jianlin Lv
2023-10-09  5:58         ` Huang, Ying
2023-10-09  7:34           ` 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=ZSOtBsigRV4RGNXn@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=iecedge@gmail.com \
    --cc=jianlv@ebay.com \
    --cc=laoar.shao@gmail.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan.x@bytedance.com \
    --cc=muchun.song@linux.dev \
    --cc=peterx@redhat.com \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeelb@google.com \
    --cc=tj@kernel.org \
    --cc=vishal.moola@gmail.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    --cc=wuyun.abel@bytedance.com \
    --cc=ying.huang@intel.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