Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1709830

[PATCHSET for-4.14] cgroup, sched: cgroup2 basic resource accounting

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject [PATCHSET for-4.14] cgroup, sched: cgroup2 basic resource accounting
Date 2017-08-11 18:40 +0200
Message-ID <udl8B-5QR-19@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

This patchset implement cgroup2 basic resource accounting and track
CPU usages on all cgroups by default.

In cgroup1, collecting non-trivial statistics by default wasn't viable
because there can be any number of hierarchies.  While cgroup2's
single hierarchy removes that part of the problem, propagating up the
hierarchy on each accounting event is still problematic.

This patchset implements cgroup2 basic resource accounting mechanism
which keeps all the counters per-cpu and propagates lazily to allow
the accounting side to only perform single per-cpu accounting in most
cases and the reader side's complexity to be O(nr updated descendants)
instead of O(nr total descendants).

This will be used by cgroup2 CPU interface later.  The patchset
contains the following three patches.

  0001-sched-cputime-Expose-cputime_adjust.patch
  0002-cpuacct-Introduce-cgroup_account_cputime-_field.patch
  0003-cgroup-Implement-cgroup2-basic-CPU-usage-accounting.patch

The patchset is on top of cgroup/for-4.14 and available in the
following git branch.

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-cgroup2-basic-acct

diffstat follows.  Thanks.

 Documentation/cgroup-v2.txt     |    9 +
 include/linux/cgroup-defs.h     |   47 +++++
 include/linux/cgroup.h          |   60 +++++++
 include/linux/sched/cputime.h   |    3 
 kernel/cgroup/Makefile          |    2 
 kernel/cgroup/cgroup-internal.h |    8 
 kernel/cgroup/cgroup.c          |   24 ++
 kernel/cgroup/stat.c            |  333 ++++++++++++++++++++++++++++++++++++++++
 kernel/sched/cpuacct.h          |   17 --
 kernel/sched/cputime.c          |    7 
 kernel/sched/deadline.c         |    2 
 kernel/sched/fair.c             |    2 
 kernel/sched/rt.c               |    2 
 kernel/sched/sched.h            |    1 
 kernel/sched/stop_task.c        |    2 
 15 files changed, 489 insertions(+), 30 deletions(-)

--
tejun

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCHSET for-4.14] cgroup, sched: cgroup2 basic resource accounting Tejun Heo <tj@kernel.org> - 2017-08-11 18:40 +0200
  [PATCH 1/3] sched/cputime: Expose cputime_adjust() Tejun Heo <tj@kernel.org> - 2017-08-11 18:40 +0200
  [PATCH 2/3] cpuacct: Introduce cgroup_account_cputime[_field]() Tejun Heo <tj@kernel.org> - 2017-08-11 18:40 +0200
    [PATCH v2 2/3] cpuacct: Introduce cgroup_account_cputime[_field]() Tejun Heo <tj@kernel.org> - 2017-08-11 19:30 +0200
  Re: [PATCHSET for-4.14] cgroup, sched: cgroup2 basic resource  accounting Tejun Heo <tj@kernel.org> - 2017-08-16 21:00 +0200
    Re: [PATCHSET for-4.14] cgroup, sched: cgroup2 basic resource  accounting Ingo Molnar <mingo@kernel.org> - 2017-08-17 10:20 +0200
      Re: [PATCHSET for-4.14] cgroup, sched: cgroup2 basic resource  accounting Tejun Heo <tj@kernel.org> - 2017-08-17 15:10 +0200
        Re: [PATCHSET for-4.14] cgroup, sched: cgroup2 basic resource  accounting Ingo Molnar <mingo@kernel.org> - 2017-08-17 17:10 +0200
  Re: [PATCHSET for-4.14] cgroup, sched: cgroup2 basic resource  accounting Tejun Heo <tj@kernel.org> - 2017-08-24 19:30 +0200

csiph-web