DAMON development mailing list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Joanne Koong" <joannelkoong@gmail.com>
Cc: damon@lists.linux.dev
Subject: Re: [PATCH v2 3/4] mm: workingset: skip the root memcg flush in workingset_test_recent()
Date: Tue, 10 Nov 2026 01:59:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-206011@kernel.org> (raw)
In-Reply-To: <20261110015321.611093-4-joannelkoong@gmail.com>

> We can skip the rstat flush in workingset_test_recent() when the
> eviction memcg is the root memcg. lruvec_page_state() now reads the LRU
> sizes of the root memcg from the node counters, which are always up to
> date, and workingset_test_recent() only reads the eviction memcg's own
> lruvec. This avoids an expensive flush on the refault path, as flushing
> the root memcg flushes every memcg in the system.
> 
> For reclaim however, we still need to keep the flush (for now) since
> global and root reclaim also read the rstat stats of the child memcgs
> they scan, which the flush is needed for in order to keep up to date.
> 
> On an 80-CPU machine, a root flush took 69us on average with little
> cgroup activity and ~0.9ms with 128 memcgs actively allocating (wall
> time, including waiting for the rstat lock). Reading a node counter
> doesn't add any cost. It took the same amount of time as reading the
> rstat counter (~150ns, which includes bpftrace probe overhead).
> 
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261110015321.611093-1-joannelkoong@gmail.com?part=3


  reply	other threads:[~2026-11-10  1:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  1:53 [PATCH v2 0/4] mm: read root memcg stats from global counters instead of flushing Joanne Koong
2026-11-10  1:53 ` [PATCH v2 1/4] mm: zswap: fix shrinker count for the root memcg Joanne Koong
2026-11-10  2:02   ` sashiko-bot
2026-11-10  1:53 ` [PATCH v2 2/4] mm: memcg: read root lruvec stats from the node counters Joanne Koong
2026-11-10  2:23   ` sashiko-bot
2026-11-10 23:10     ` Joanne Koong
2026-11-11 17:47       ` Michal Koutný
2026-11-10  1:53 ` [PATCH v2 3/4] mm: workingset: skip the root memcg flush in workingset_test_recent() Joanne Koong
2026-11-10  1:59   ` sashiko-bot [this message]
2026-11-10  1:53 ` [PATCH v2 4/4] mm/damon/core: use node counters instead of flushing the root memcg Joanne Koong
2026-11-10  1:58   ` sashiko-bot

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=sashiko-outbox-206011@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=damon@lists.linux.dev \
    --cc=joannelkoong@gmail.com \
    --cc=sashiko-reviews@lists.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