)]}'
{
  "commit": "0c3e73e84fe3f64cf1c2e8bb4e91e8901cbcdc38",
  "tree": "1c3e27fce3babd3703b34c9a353f253fcefb6325",
  "parents": [
    "4e41695356fb4e0b153be1440ad027e46e0a7ea2"
  ],
  "author": {
    "name": "Balbir Singh",
    "email": "balbir@linux.vnet.ibm.com",
    "time": "Wed Sep 23 15:56:42 2009 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Sep 24 07:20:59 2009 -0700"
  },
  "message": "memcg: improve resource counter scalability\n\nReduce the resource counter overhead (mostly spinlock) associated with the\nroot cgroup.  This is a part of the several patches to reduce mem cgroup\noverhead.  I had posted other approaches earlier (including using percpu\ncounters).  Those patches will be a natural addition and will be added\niteratively on top of these.\n\nThe patch stops resource counter accounting for the root cgroup.  The data\nfor display is derived from the statisitcs we maintain via\nmem_cgroup_charge_statistics (which is more scalable).  What happens today\nis that, we do double accounting, once using res_counter_charge() and once\nusing memory_cgroup_charge_statistics().  For the root, since we don\u0027t\nimplement limits any more, we don\u0027t need to track every charge via\nres_counter_charge() and check for limit being exceeded and reclaim.\n\nThe main mem-\u003eres usage_in_bytes can be derived by summing the cache and\nrss usage data from memory statistics (MEM_CGROUP_STAT_RSS and\nMEM_CGROUP_STAT_CACHE).  However, for memsw-\u003eres usage_in_bytes, we need\nadditional data about swapped out memory.  This patch adds a\nMEM_CGROUP_STAT_SWAPOUT and uses that along with MEM_CGROUP_STAT_RSS and\nMEM_CGROUP_STAT_CACHE to derive the memsw data.  This data is computed\nrecursively when hierarchy is enabled.\n\nThe tests results I see on a 24 way show that\n\n1. The lock contention disappears from /proc/lock_stats\n2. The results of the test are comparable to running with\n   cgroup_disable\u003dmemory.\n\nHere is a sample of my program runs\n\nWithout Patch\n\n Performance counter stats for \u0027/home/balbir/parallel_pagefault\u0027:\n\n 7192804.124144  task-clock-msecs         #     23.937 CPUs\n         424691  context-switches         #      0.000 M/sec\n            267  CPU-migrations           #      0.000 M/sec\n       28498113  page-faults              #      0.004 M/sec\n  5826093739340  cycles                   #    809.989 M/sec\n   408883496292  instructions             #      0.070 IPC\n     7057079452  cache-references         #      0.981 M/sec\n     3036086243  cache-misses             #      0.422 M/sec\n\n  300.485365680  seconds time elapsed\n\nWith cgroup_disable\u003dmemory\n\n Performance counter stats for \u0027/home/balbir/parallel_pagefault\u0027:\n\n 7182183.546587  task-clock-msecs         #     23.915 CPUs\n         425458  context-switches         #      0.000 M/sec\n            203  CPU-migrations           #      0.000 M/sec\n       92545093  page-faults              #      0.013 M/sec\n  6034363609986  cycles                   #    840.185 M/sec\n   437204346785  instructions             #      0.072 IPC\n     6636073192  cache-references         #      0.924 M/sec\n     2358117732  cache-misses             #      0.328 M/sec\n\n  300.320905827  seconds time elapsed\n\nWith this patch applied\n\n Performance counter stats for \u0027/home/balbir/parallel_pagefault\u0027:\n\n 7191619.223977  task-clock-msecs         #     23.955 CPUs\n         422579  context-switches         #      0.000 M/sec\n             88  CPU-migrations           #      0.000 M/sec\n       91946060  page-faults              #      0.013 M/sec\n  5957054385619  cycles                   #    828.333 M/sec\n  1058117350365  instructions             #      0.178 IPC\n     9161776218  cache-references         #      1.274 M/sec\n     1920494280  cache-misses             #      0.267 M/sec\n\n  300.218764862  seconds time elapsed\n\nData from Prarit (kernel compile with make -j64 on a 64\nCPU/32G machine)\n\nFor a single run\n\nWithout patch\n\nreal 27m8.988s\nuser 87m24.916s\nsys 382m6.037s\n\nWith patch\n\nreal    4m18.607s\nuser    84m58.943s\nsys     50m52.682s\n\nWith config turned off\n\nreal    4m54.972s\nuser    90m13.456s\nsys     50m19.711s\n\nNOTE: The data looks counterintuitive due to the increased performance\nwith the patch, even over the config being turned off. We probably need\nmore runs, but so far all testing has shown that the patches definitely\nhelp.\n\n[akpm@linux-foundation.org: coding-style fixes]\nSigned-off-by: Balbir Singh \u003cbalbir@linux.vnet.ibm.com\u003e\nCc: Prarit Bhargava \u003cprarit@redhat.com\u003e\nCc: Andi Kleen \u003candi@firstfloor.org\u003e\nReviewed-by: KAMEZAWA Hiroyuki \u003ckamezawa.hiroyu@jp.fujitsu.com\u003e\nReviewed-by: Daisuke Nishimura \u003cnishimura@mxp.nes.nec.co.jp\u003e\nCc: KOSAKI Motohiro \u003ckosaki.motohiro@jp.fujitsu.com\u003e\nCc: Paul Menage \u003cmenage@google.com\u003e\nCc: Li Zefan \u003clizf@cn.fujitsu.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "011aba6cad70fa58a887bf6220a888a8d4985598",
      "old_mode": 33188,
      "old_path": "mm/memcontrol.c",
      "new_id": "2011f15278fd6eba5c9c462119bc25b6b348fadc",
      "new_mode": 33188,
      "new_path": "mm/memcontrol.c"
    }
  ]
}
