)]}'
{
  "commit": "a63d83f427fbce97a6cea0db2e64b0eb8435cd10",
  "tree": "8ac229cdf6e2289d97e82e35774057106fe7f4a2",
  "parents": [
    "74bcbf40546bb7500f2a7ba4ff3cc056a6bd004a"
  ],
  "author": {
    "name": "David Rientjes",
    "email": "rientjes@google.com",
    "time": "Mon Aug 09 17:19:46 2010 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Mon Aug 09 20:45:02 2010 -0700"
  },
  "message": "oom: badness heuristic rewrite\n\nThis a complete rewrite of the oom killer\u0027s badness() heuristic which is\nused to determine which task to kill in oom conditions.  The goal is to\nmake it as simple and predictable as possible so the results are better\nunderstood and we end up killing the task which will lead to the most\nmemory freeing while still respecting the fine-tuning from userspace.\n\nInstead of basing the heuristic on mm-\u003etotal_vm for each task, the task\u0027s\nrss and swap space is used instead.  This is a better indication of the\namount of memory that will be freeable if the oom killed task is chosen\nand subsequently exits.  This helps specifically in cases where KDE or\nGNOME is chosen for oom kill on desktop systems instead of a memory\nhogging task.\n\nThe baseline for the heuristic is a proportion of memory that each task is\ncurrently using in memory plus swap compared to the amount of \"allowable\"\nmemory.  \"Allowable,\" in this sense, means the system-wide resources for\nunconstrained oom conditions, the set of mempolicy nodes, the mems\nattached to current\u0027s cpuset, or a memory controller\u0027s limit.  The\nproportion is given on a scale of 0 (never kill) to 1000 (always kill),\nroughly meaning that if a task has a badness() score of 500 that the task\nconsumes approximately 50% of allowable memory resident in RAM or in swap\nspace.\n\nThe proportion is always relative to the amount of \"allowable\" memory and\nnot the total amount of RAM systemwide so that mempolicies and cpusets may\noperate in isolation; they shall not need to know the true size of the\nmachine on which they are running if they are bound to a specific set of\nnodes or mems, respectively.\n\nRoot tasks are given 3% extra memory just like __vm_enough_memory()\nprovides in LSMs.  In the event of two tasks consuming similar amounts of\nmemory, it is generally better to save root\u0027s task.\n\nBecause of the change in the badness() heuristic\u0027s baseline, it is also\nnecessary to introduce a new user interface to tune it.  It\u0027s not possible\nto redefine the meaning of /proc/pid/oom_adj with a new scale since the\nABI cannot be changed for backward compatability.  Instead, a new tunable,\n/proc/pid/oom_score_adj, is added that ranges from -1000 to +1000.  It may\nbe used to polarize the heuristic such that certain tasks are never\nconsidered for oom kill while others may always be considered.  The value\nis added directly into the badness() score so a value of -500, for\nexample, means to discount 50% of its memory consumption in comparison to\nother tasks either on the system, bound to the mempolicy, in the cpuset,\nor sharing the same memory controller.\n\n/proc/pid/oom_adj is changed so that its meaning is rescaled into the\nunits used by /proc/pid/oom_score_adj, and vice versa.  Changing one of\nthese per-task tunables will rescale the value of the other to an\nequivalent meaning.  Although /proc/pid/oom_adj was originally defined as\na bitshift on the badness score, it now shares the same linear growth as\n/proc/pid/oom_score_adj but with different granularity.  This is required\nso the ABI is not broken with userspace applications and allows oom_adj to\nbe deprecated for future removal.\n\nSigned-off-by: David Rientjes \u003crientjes@google.com\u003e\nCc: Nick Piggin \u003cnpiggin@suse.de\u003e\nCc: KAMEZAWA Hiroyuki \u003ckamezawa.hiroyu@jp.fujitsu.com\u003e\nCc: KOSAKI Motohiro \u003ckosaki.motohiro@jp.fujitsu.com\u003e\nCc: Oleg Nesterov \u003coleg@redhat.com\u003e\nCc: Balbir Singh \u003cbalbir@in.ibm.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": "8fe8895894d83463038b876ff078ba1c44a4c9b0",
      "old_mode": 33188,
      "old_path": "Documentation/filesystems/proc.txt",
      "new_id": "cf1295c2bb66dc59a08a1a377b87a1889ca7df01",
      "new_mode": 33188,
      "new_path": "Documentation/filesystems/proc.txt"
    },
    {
      "type": "modify",
      "old_id": "5949d0ac30f2d8b6f0b3a3027a0872c4244f49c6",
      "old_mode": 33188,
      "old_path": "fs/proc/base.c",
      "new_id": "f923b728388ae2ee1e75d54dd127c6288f120683",
      "new_mode": 33188,
      "new_path": "fs/proc/base.c"
    },
    {
      "type": "modify",
      "old_id": "9f1afd361583f794e28bcdcd1e6ad20a5288e3af",
      "old_mode": 33188,
      "old_path": "include/linux/memcontrol.h",
      "new_id": "73564cac38c77b31786caf1303f5b44582af0ee6",
      "new_mode": 33188,
      "new_path": "include/linux/memcontrol.h"
    },
    {
      "type": "modify",
      "old_id": "40e5e3a6bc2018a2fee2bf43777ad749bce63101",
      "old_mode": 33188,
      "old_path": "include/linux/oom.h",
      "new_id": "73b8d7b6dd19055183206d25f336876073a7d0e7",
      "new_mode": 33188,
      "new_path": "include/linux/oom.h"
    },
    {
      "type": "modify",
      "old_id": "9591907c4f79262e82089cfa5c1f1cae502d56e0",
      "old_mode": 33188,
      "old_path": "include/linux/sched.h",
      "new_id": "ce160d68f5e706fb3c157940e68ccac3627dccef",
      "new_mode": 33188,
      "new_path": "include/linux/sched.h"
    },
    {
      "type": "modify",
      "old_id": "a82a65cef741935adc51082640f63c9a5049b5ea",
      "old_mode": 33188,
      "old_path": "kernel/fork.c",
      "new_id": "98b450876f93878b437bbbc6efe6abd1c4028b29",
      "new_mode": 33188,
      "new_path": "kernel/fork.c"
    },
    {
      "type": "modify",
      "old_id": "31abd1c2c0c5b2f3f9f1b5cb197a948cddb76596",
      "old_mode": 33188,
      "old_path": "mm/memcontrol.c",
      "new_id": "de54ea0094a1be4e512b0ac602e28d2a3ac4a695",
      "new_mode": 33188,
      "new_path": "mm/memcontrol.c"
    },
    {
      "type": "modify",
      "old_id": "0a4ca8a0234b5da6696235dd79c15ea1ed046a8f",
      "old_mode": 33188,
      "old_path": "mm/oom_kill.c",
      "new_id": "d3def05a33d99f6699e6dd6ea9472e6e7da54443",
      "new_mode": 33188,
      "new_path": "mm/oom_kill.c"
    }
  ]
}
