Re: [PATCH] memcg: keep propagating stats updates to ancestors
From: Mingyu He
Date: Tue Oct 13 2026 - 03:30:14 EST
On Mon, Oct 12, 2026 at 7:08 PM Shakeel Butt <shakeel.butt@xxxxxxxxx> wrote:
> Please share your custom in-kernel consumer. Let's not make changes in the
> kernel for things which are not in upstreame kernel.
My custom kernel only has a few changes from upstream.
I just call mem_cgroup_flush_stats() and then call memcg_page_state() in
a kworker to judge whether to do a page cache shrinking.
> > Regarding the BPF interface, the implementation in the tree I found is:
> >
> > __bpf_kfunc void bpf_mem_cgroup_flush_stats(struct mem_cgroup *memcg)
> > {
> > mem_cgroup_flush_stats(memcg);
>
> Let's make this force flush.
I am not sure what you mean. Do you mean that only change this bpf function to
force flush, and keep memcg_rstat_updated unchanged?
If you mean that, I think this is a good approach.
But I think we also had better to add some comments to memcg_rstat_updated()
to inform callers about this behavior ( maybe has a large data flush latency).
Thanks,
Runli