Thread (30 messages) 30 messages, 3 authors, 2022-05-13

Re: [RFC PATCH bpf-next 2/9] cgroup: bpf: flush bpf stats on rstat flush

From: Tejun Heo <tj@kernel.org>
Date: 2022-05-10 18:46:49
Also in: bpf, cgroups, lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help