Linux cgroups development
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: akpm@linux-foundation.org, david@kernel.org, yosry@kernel.org,
	mkoutny@suse.com, shakeel.butt@linux.dev, hannes@cmpxchg.org,
	mhocko@kernel.org, roman.gushchin@linux.dev,
	muchun.song@linux.dev, nphamcs@gmail.com,
	chengming.zhou@linux.dev, sj@kernel.org, ljs@kernel.org,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	damon@lists.linux.dev
Subject: Re: [PATCH v3 2/4] mm: memcg: read root lruvec stats from the node counters
Date: Mon, 16 Nov 2026 21:07:32 -0800	[thread overview]
Message-ID: <avvhFAxBcPk5Q6pW@chrisdown.name> (raw)
In-Reply-To: <20261114002822.1043378-3-joannelkoong@gmail.com>

Hi Joanne,

Joanne Koong writes:
>The exceptions are the kernel memory stats (slab, kernel stack, page
>tables, secondary page tables and vmalloc), hugetlb, and
>WORKINGSET_NODERECLAIM, which counts reclaimed xarray nodes (slab
>objects). Their node counters also count memory that isn't charged to a
>memcg, which falls into two categories:

This still describes the v2 denylist. With the allowlist, the root memcg
also keeps reading rstat for NR_ANON_MAPPED, NR_FILE_MAPPED, NR_SHMEM et
al, and some of those differ for reasons outside the two categories here,
like swapcache being counted differently in the node counter, for
example. Could the changelog say what is on the list instead? So that
would be the stats that only change through mod_lruvec_state(), with
everything else still reading rstat.

>+	case PGROTATE_ANON:
>+	case PGROTATE_FILE:
>+	case PGREFILL:
>+		return true;

NR_VMSCAN_WRITE isn't on the list, but prepare_scan_control() adds it to
WORKINGSET_RESTORE_ANON, so once the root flush in reclaim goes away,
root reclaim would mix a live node counter with a stale rstat value.
Unless I'm mistaken it should go here as well.

Once those are fixed, please feel free to add:

Reviewed-by: Chris Down <chris@chrisdown.name>

Thanks!

Chris

  reply	other threads:[~2026-11-17  5:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14  0:28 [PATCH v3 0/4] mm: read root memcg stats from global counters instead of flushing Joanne Koong
2026-11-14  0:28 ` [PATCH v3 1/4] mm: zswap: fix shrinker count for the root memcg Joanne Koong
2026-11-17  5:07   ` Chris Down
2026-11-14  0:28 ` [PATCH v3 2/4] mm: memcg: read root lruvec stats from the node counters Joanne Koong
2026-11-17  5:07   ` Chris Down [this message]
2026-11-14  0:28 ` [PATCH v3 3/4] mm: workingset: skip the root memcg flush in workingset_test_recent() Joanne Koong
2026-11-17  5:07   ` Chris Down
2026-11-14  0:28 ` [PATCH v3 4/4] mm/damon/core: use node counters instead of flushing the root memcg Joanne Koong
2026-11-17  5:07   ` Chris Down

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=avvhFAxBcPk5Q6pW@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=chengming.zhou@linux.dev \
    --cc=damon@lists.linux.dev \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=joannelkoong@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=nphamcs@gmail.com \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=sj@kernel.org \
    --cc=yosry@kernel.org \
    /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