Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: Runli <mingyu.he@shopee.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Hocko" <mhocko@kernel.org>,
	"Roman Gushchin" <roman.gushchin@linux.dev>,
	"Shakeel Butt" <shakeel.butt@linux.dev>,
	linux-mm@kvack.org
Cc: "Muchun Song" <muchun.song@linux.dev>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Yosry Ahmed" <yosry@kernel.org>,
	littleswimmingwhale@gmail.com, tj@kernel.org, mkoutny@suse.com
Subject: Re: [PATCH v3] mm/bpf: Always flush memcg stats when explicitly requested
Date: Fri, 13 Nov 2026 04:14:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-212161@kernel.org> (raw)
In-Reply-To: <20261112041348.66915-1-mingyu.he@shopee.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] mm/bpf: single-word nickname in Author and Signed-off-by
  trailer
--

commit 4c2af3a1c095e013e48cf708056b8f9ea3fe242a
Author: Runli <mingyu.he@shopee.com>

> mm/bpf: Always flush memcg stats when explicitly requested
>
> memcg_rstat_updated() stops walking the ancestors when a memcg exceeds
> the flush threshold. A concurrent flush can leave an ancestor below the
> threshold, so the early exit prevents it from receiving further updates.
>
> Consider root and leaf on a 4-CPU system, with a threshold of 256.
> CPU 0 is flushing another CPU's stats after CPU 1's stats have already
> been flushed. The counts below are shared stats_updates counters:
>
>   CPU 0 (root flush)                CPU 1 (leaf updates)
>   ------------------               --------------------
>   clear leaf->stats_updates
>                                    add 64 to leaf and root
>   clear root->stats_updates
>   finish flush
>                                    leaf = 64, root = 0
>                                    4 more batches of 64:
>                                      leaf = 320, root = 256
>                                    next update:
>                                      leaf > threshold
>                                      break; root is not updated
>
> Root remains at the threshold, which is insufficient to trigger a flush,
> while further leaf updates keep taking the early exit. The periodic
> forced flush restores progress, but until then the root's aggregated
> statistics can fall far behind. For example, page cache grows at rate of
> 1 GiB/s, a two-second wait can leave the reported usage about 2 GiB below
> the actual usage.
>
> Make bpf_mem_cgroup_flush_stats() force a flush without waiting for the
> periodic flusher, while preserving the memcg flush bookkeeping.
>
> Suggested-by: Shakeel Butt <shakeel.butt@linux.dev>
> Link: https://lore.kernel.org/all/avKy9oMwDRjKjfzm@linux.dev/
> Signed-off-by: Runli <mingyu.he@shopee.com>

[Severity: High]
Documentation/process/submitting-patches.rst requires a full real name
rather than a single-word nickname or handle in the Author header and
Signed-off-by trailer (for example, Mingyu He <mingyu.he@shopee.com>).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112041348.66915-1-mingyu.he@shopee.com?part=1


      reply	other threads:[~2026-11-13  4:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  4:13 [PATCH v3] mm/bpf: Always flush memcg stats when explicitly requested Runli
2026-11-13  4:14 ` sashiko-bot [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=sashiko-outbox-212161@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=littleswimmingwhale@gmail.com \
    --cc=mhocko@kernel.org \
    --cc=mingyu.he@shopee.com \
    --cc=mkoutny@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=tj@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