mbox series

[0/9,RFC] cgroup: separate rstat trees

Message ID 20241224011402.134009-1-inwardvessel@gmail.com (mailing list archive)
Headers show
Series cgroup: separate rstat trees | expand

Message

JP Kobryn Dec. 24, 2024, 1:13 a.m. UTC
I've been experimenting with these changes to allow for separate
updating/flushing of cgroup stats per-subsystem. The idea was instead of having
a single per-cpu rstat tree for managing stats across all subsystems, we could
maybe split up the rstat trees into separate trees for each subsystem. So each
cpu would have individual trees for each subsystem. It would allow subsystems
to update and flush their stats without having any contention with others, i.e.
the io subsystem would not have to wait for an in progress memory subsystem
flush to finish. The core change is moving the rstat entities off of the cgroup
struct and onto the cgroup_subsystem_state struct. Every patch revolves around
that concept.

I reached a point where this started to feel stable in my local testing, so I
wanted to share and get feedback on this approach.

JP Kobryn (8):
  change cgroup to css in rstat updated and flush api
  change cgroup to css in rstat internal flush and lock funcs
  change cgroup to css in rstat init and exit api
  split rstat from cgroup into separate css
  separate locking between base css and others
  isolate base stat flush
  remove unneeded rcu list
  remove bpf rstat flush from css generic flush

 block/blk-cgroup.c              |   4 +-
 include/linux/cgroup-defs.h     |  35 ++---
 include/linux/cgroup.h          |   8 +-
 kernel/cgroup/cgroup-internal.h |   4 +-
 kernel/cgroup/cgroup.c          |  79 ++++++-----
 kernel/cgroup/rstat.c           | 225 +++++++++++++++++++-------------
 mm/memcontrol.c                 |   4 +-
 7 files changed, 203 insertions(+), 156 deletions(-)

Comments

Shakeel Butt Dec. 24, 2024, 4:57 a.m. UTC | #1
Thanks JP for the awesome work. Please CC Tejun and Michal in the
followup revisions.

On Mon, Dec 23, 2024 at 05:13:53PM -0800, JP Kobryn wrote:
> I've been experimenting with these changes to allow for separate
> updating/flushing of cgroup stats per-subsystem. The idea was instead of having
> a single per-cpu rstat tree for managing stats across all subsystems, we could
> maybe split up the rstat trees into separate trees for each subsystem. So each
> cpu would have individual trees for each subsystem. It would allow subsystems
> to update and flush their stats without having any contention with others, i.e.
> the io subsystem would not have to wait for an in progress memory subsystem
> flush to finish. The core change is moving the rstat entities off of the cgroup
> struct and onto the cgroup_subsystem_state struct. Every patch revolves around
> that concept.
> 
> I reached a point where this started to feel stable in my local testing, so I
> wanted to share and get feedback on this approach.

For the cover letter, please start with describing the problem you are
trying to solve and then possibly give an overview of the solution you
are proposing.