linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: "T.J. Mercier" <tjmercier@google.com>, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	android-mm@google.com,  stable@vger.kernel.org
Subject: Re: [PATCH mm-unstable] mm: multi-gen LRU: don't spin during memcg release
Date: Mon, 14 Aug 2023 09:59:06 -0600	[thread overview]
Message-ID: <CAOUHufZg=RpSMeQSaag0mXH_UAASPtqPVUtC-u9V=j826Vpo4Q@mail.gmail.com> (raw)
In-Reply-To: <20230814151636.1639123-1-tjmercier@google.com>

On Mon, Aug 14, 2023 at 9:16 AM T.J. Mercier <tjmercier@google.com> wrote:
>
> When a memcg is in the process of being released mem_cgroup_tryget will
> fail because its reference count has already reached 0. This can happen
> during reclaim if the memcg has already been offlined, and we reclaim
> all remaining pages attributed to the offlined memcg. shrink_many
> attempts to skip the empty memcg in this case, and continue reclaiming
> from the remaining memcgs in the old generation. If there is only one
> memcg remaining, or if all remaining memcgs are in the process of being
> released then shrink_many will spin until all memcgs have finished
> being released. The release occurs through a workqueue, so it can take
> a while before kswapd is able to make any further progress.
>
> This fix results in reductions in kswapd activity and direct reclaim in
> a test where 28 apps (working set size > total memory) are repeatedly
> launched in a random sequence:
>
>                                        A          B      delta   ratio(%)
>            allocstall_movable       5962       3539      -2423     -40.64
>             allocstall_normal       2661       2417       -244      -9.17
> kswapd_high_wmark_hit_quickly      53152       7594     -45558     -85.71
>                    pageoutrun      57365      11750     -45615     -79.52
>
> Fixes: e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists")
> Cc: stable@vger.kernel.org
> Signed-off-by: T.J. Mercier <tjmercier@google.com>

Acked-by: Yu Zhao <yuzhao@google.com>


      reply	other threads:[~2023-08-14 15:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 15:16 T.J. Mercier
2023-08-14 15:59 ` Yu Zhao [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='CAOUHufZg=RpSMeQSaag0mXH_UAASPtqPVUtC-u9V=j826Vpo4Q@mail.gmail.com' \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=android-mm@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=stable@vger.kernel.org \
    --cc=tjmercier@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