)]}'
{
  "commit": "428ea394a71d4abfbd23914d58d764ee07d36c7d",
  "tree": "e18fb37ea542731e93a86bb639eebdc13c5cee0b",
  "parents": [
    "1f88d33de13b02e2d6235c0d9451cd10c6e8210f"
  ],
  "author": {
    "name": "Tejun Heo",
    "email": "tj@kernel.org",
    "time": "Fri Aug 11 10:24:12 2017 -0700"
  },
  "committer": {
    "name": "Tejun Heo",
    "email": "tj@kernel.org",
    "time": "Fri Aug 11 10:24:12 2017 -0700"
  },
  "message": "cgroup: Implement cgroup2 basic CPU usage accounting\n\nIn cgroup1, while cpuacct isn\u0027t actually controlling any resources, it\nis a separate controller due to combinaton of two factors -\n1. enabling cpu controller has significant side effects, and 2. we\nhave to pick one of the hierarchies to account CPU usages on.  cpuacct\ncontroller is effectively used to designate a hierarchy to track CPU\nusages on.\n\ncgroup2\u0027s unified hierarchy removes the second reason and we can\naccount basic CPU usages by default.  While we can use cpuacct for\nthis purpose, both its interface and implementation leave a lot to be\ndesired - it collects and exposes two sources of truth which don\u0027t\nagree with each other and some of the exposed statistics don\u0027t make\nmuch sense.  Also, it propagates all the way up the hierarchy on each\naccounting event which is unnecessary.\n\nThis patch adds basic resource accounting mechanism to cgroup2\u0027s\nunified hierarchy and accounts CPU usages using it.\n\n* All accountings are done per-cpu and don\u0027t propagate immediately.\n  It just bumps the per-cgroup per-cpu counters and links to the\n  parent\u0027s updated list if not already on it.\n\n* On a read, the per-cpu counters are collected into the global ones\n  and then propagated upwards.  Only the per-cpu counters which have\n  changed since the last read are propagated.\n\n* CPU usage stats are collected and shown in \"cgroup.stat\" with \"cpu.\"\n  prefix.  Total usage is collected from scheduling events.  User/sys\n  breakdown is sourced from tick sampling and adjusted to the usage\n  using cputime_adjuts().\n\nThis keeps the accounting side hot path O(1) and per-cpu and the read\nside O(nr_updated_since_last_read).\n\nSigned-off-by: Tejun Heo \u003ctj@kernel.org\u003e\nCc: Ingo Molnar \u003cmingo@redhat.com\u003e\nCc: Peter Zijlstra \u003cpeterz@infradead.org\u003e\nCc: Li Zefan \u003clizefan@huawei.com\u003e\nCc: Johannes Weiner \u003channes@cmpxchg.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "dc44785dc0fa146a2de30aa11ef2c410f1b00622",
      "old_mode": 33188,
      "old_path": "Documentation/cgroup-v2.txt",
      "new_id": "3f8216912df001afb183049451f89b171e39ded6",
      "new_mode": 33188,
      "new_path": "Documentation/cgroup-v2.txt"
    },
    {
      "type": "modify",
      "old_id": "59e4ad9e7baca679feb882d68dc97580c9dd1df4",
      "old_mode": 33188,
      "old_path": "include/linux/cgroup-defs.h",
      "new_id": "17da9c82b93970a36caa6f57429e2628e20691f1",
      "new_mode": 33188,
      "new_path": "include/linux/cgroup-defs.h"
    },
    {
      "type": "modify",
      "old_id": "f395e024071f10dfe96ccff343dfee91709cff8d",
      "old_mode": 33188,
      "old_path": "include/linux/cgroup.h",
      "new_id": "4c8221295429cbd2947014efb1abf319aadfd870",
      "new_mode": 33188,
      "new_path": "include/linux/cgroup.h"
    },
    {
      "type": "modify",
      "old_id": "ce693ccb8c58fa4f5be8532790ab8b0ca50a3b9a",
      "old_mode": 33188,
      "old_path": "kernel/cgroup/Makefile",
      "new_id": "0acee616e06cb304053b54831741128a92f28924",
      "new_mode": 33188,
      "new_path": "kernel/cgroup/Makefile"
    },
    {
      "type": "modify",
      "old_id": "c167a40278e63b86f0e04f22167e3280751a28d0",
      "old_mode": 33188,
      "old_path": "kernel/cgroup/cgroup-internal.h",
      "new_id": "f17da0978d5164218942fc347172f88acc2cf6c2",
      "new_mode": 33188,
      "new_path": "kernel/cgroup/cgroup-internal.h"
    },
    {
      "type": "modify",
      "old_id": "c038ccf95b5dd5d53e2f6c0b7ffccd59da9e891f",
      "old_mode": 33188,
      "old_path": "kernel/cgroup/cgroup.c",
      "new_id": "a399a559f582b5c9b378d437d3765900e774f7e3",
      "new_mode": 33188,
      "new_path": "kernel/cgroup/cgroup.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "19a10b23b83ef304dc6ad95cf4dae71c9be56db3",
      "new_mode": 33188,
      "new_path": "kernel/cgroup/stat.c"
    }
  ]
}
