)]}'
{
  "commit": "74046494ea68676d29ef6501a4bd950f08112a2c",
  "tree": "4fb862c2ebeba25b089ed64d5cc36437ad9e3df2",
  "parents": [
    "42be35d0390b966253136a285f507f5ad00fd9e8"
  ],
  "author": {
    "name": "Gilad Ben-Yossef",
    "email": "gilad@benyossef.com",
    "time": "Wed Mar 28 14:42:45 2012 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Wed Mar 28 17:14:35 2012 -0700"
  },
  "message": "mm: only IPI CPUs to drain local pages if they exist\n\nCalculate a cpumask of CPUs with per-cpu pages in any zone and only send\nan IPI requesting CPUs to drain these pages to the buddy allocator if they\nactually have pages when asked to flush.\n\nThis patch saves 85%+ of IPIs asking to drain per-cpu pages in case of\nsevere memory pressure that leads to OOM since in these cases multiple,\npossibly concurrent, allocation requests end up in the direct reclaim code\npath so when the per-cpu pages end up reclaimed on first allocation\nfailure for most of the proceeding allocation attempts until the memory\npressure is off (possibly via the OOM killer) there are no per-cpu pages\non most CPUs (and there can easily be hundreds of them).\n\nThis also has the side effect of shortening the average latency of direct\nreclaim by 1 or more order of magnitude since waiting for all the CPUs to\nACK the IPI takes a long time.\n\nTested by running \"hackbench 400\" on a 8 CPU x86 VM and observing the\ndifference between the number of direct reclaim attempts that end up in\ndrain_all_pages() and those were more then 1/2 of the online CPU had any\nper-cpu page in them, using the vmstat counters introduced in the next\npatch in the series and using proc/interrupts.\n\nIn the test sceanrio, this was seen to save around 3600 global\nIPIs after trigerring an OOM on a concurrent workload:\n\n$ cat /proc/vmstat | tail -n 2\npcp_global_drain 0\npcp_global_ipi_saved 0\n\n$ cat /proc/interrupts | grep CAL\nCAL:          1          2          1          2\n          2          2          2          2   Function call interrupts\n\n$ hackbench 400\n[OOM messages snipped]\n\n$ cat /proc/vmstat | tail -n 2\npcp_global_drain 3647\npcp_global_ipi_saved 3642\n\n$ cat /proc/interrupts | grep CAL\nCAL:          6         13          6          3\n          3          3         1 2          7   Function call interrupts\n\nPlease note that if the global drain is removed from the direct reclaim\npath as a patch from Mel Gorman currently suggests this should be replaced\nwith an on_each_cpu_cond invocation.\n\nSigned-off-by: Gilad Ben-Yossef \u003cgilad@benyossef.com\u003e\nAcked-by: Mel Gorman \u003cmel@csn.ul.ie\u003e\nCc: KOSAKI Motohiro \u003ckosaki.motohiro@jp.fujitsu.com\u003e\nAcked-by: Christoph Lameter \u003ccl@linux.com\u003e\nAcked-by: Peter Zijlstra \u003ca.p.zijlstra@chello.nl\u003e\nCc: Pekka Enberg \u003cpenberg@kernel.org\u003e\nCc: Rik van Riel \u003criel@redhat.com\u003e\nCc: Andi Kleen \u003candi@firstfloor.org\u003e\nAcked-by: Michal Nazarewicz \u003cmina86@mina86.org\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": "c313afcc8e5aeb52e7b142cfcd7e00d3b595a563",
      "old_mode": 33188,
      "old_path": "mm/page_alloc.c",
      "new_id": "a712fb9e04ce4c6914c34b4a80f5526c7b49f346",
      "new_mode": 33188,
      "new_path": "mm/page_alloc.c"
    }
  ]
}
