[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ynqy20FjoCIqHZ1M@slm.duckdns.org>
Date: Tue, 10 May 2022 08:45:47 -1000
From: Tejun Heo <tj@...nel.org>
To: Yosry Ahmed <yosryahmed@...gle.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Hao Luo <haoluo@...gle.com>,
Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>,
Shuah Khan <shuah@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Michal Hocko <mhocko@...nel.org>,
Stanislav Fomichev <sdf@...gle.com>,
David Rientjes <rientjes@...gle.com>,
Greg Thelen <gthelen@...gle.com>,
Shakeel Butt <shakeelb@...gle.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
bpf@...r.kernel.org, cgroups@...r.kernel.org
Subject: Re: [RFC PATCH bpf-next 2/9] cgroup: bpf: flush bpf stats on rstat
flush
On Tue, May 10, 2022 at 12:18:00AM +0000, Yosry Ahmed wrote:
> When a cgroup is popped from the rstat updated tree, subsystems rstat
> flushers are run through the css_rstat_flush() callback. Also run bpf
> flushers for all subsystems that have at least one bpf rstat flusher
> attached, and are enabled for this cgroup.
>
> A list of subsystems that have attached rstat flushers is maintained to
> avoid looping through all subsystems for all cpus for every cgroup that
> is being popped from the updated tree. Since we introduce a lock here to
> protect this list, also use it to protect rstat_flushers lists inside
> each subsystem (since they both need to locked together anyway), and get
> read of the locks in struct cgroup_subsys_bpf.
>
> rstat flushers are run for any enabled subsystem that has flushers
> attached, even if it does not subscribe to css flushing through
> css_rstat_flush(). This gives flexibility for bpf programs to collect
> stats for any subsystem, regardless of the implementation changes in the
> kernel.
Yeah, again, the fact that these things are associated with a speicfic
subsystem feels a bit jarring to me. Let's get that resolved first.
Thanks.
--
tejun
Powered by blists - more mailing lists