)]}'
{
  "commit": "0c1eecfb345401629aa57c9d3b077273e56c45a7",
  "tree": "522d7090966c6e70f3147c30e3308781e0309938",
  "parents": [
    "b1457bcc3a00a0446c7f6e2f22fd24b6d8d0a309"
  ],
  "author": {
    "name": "Rafael J. Wysocki",
    "email": "rjw@sisk.pl",
    "time": "Thu Jul 19 01:47:33 2007 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@woody.linux-foundation.org",
    "time": "Thu Jul 19 10:04:42 2007 -0700"
  },
  "message": "Freezer: avoid freezing kernel threads prematurely\n\nKernel threads should not have TIF_FREEZE set when user space processes are\nbeing frozen, since otherwise some of them might be frozen prematurely.\nTo prevent this from happening we can (1) make exit_mm() unset TIF_FREEZE\nunconditionally just after clearing tsk-\u003emm and (2) make try_to_freeze_tasks()\ncheck if p-\u003emm is different from zero and PF_BORROWED_MM is unset in p-\u003eflags\nwhen user space processes are to be frozen.\n\nNamely, when user space processes are being frozen, we only should set\nTIF_FREEZE for tasks that have p-\u003emm different from NULL and don\u0027t have\nPF_BORROWED_MM set in p-\u003eflags.  For this reason task_lock() must be used to\nprevent try_to_freeze_tasks() from racing with use_mm()/unuse_mm(), in which\np-\u003emm and p-\u003eflags.PF_BORROWED_MM are changed under task_lock(p).  Also, we\nneed to prevent the following scenario from happening:\n\n* daemonize() is called by a task spawned from a user space code path\n* freezer checks if the task has p-\u003emm set and the result is positive\n* task enters exit_mm() and clears its TIF_FREEZE\n* freezer sets TIF_FREEZE for the task\n* task calls try_to_freeze() and goes to the refrigerator, which is wrong at\n  that point\n\nThis requires us to acquire task_lock(p) before p-\u003eflags.PF_BORROWED_MM and\np-\u003emm are examined and release it after TIF_FREEZE is set for p (or it turns\nout that TIF_FREEZE should not be set).\n\nSigned-off-by: Rafael J. Wysocki \u003crjw@sisk.pl\u003e\nCc: Gautham R Shenoy \u003cego@in.ibm.com\u003e\nCc: Pavel Machek \u003cpavel@ucw.cz\u003e\nCc: Nigel Cunningham \u003cnigel@nigel.suspend2.net\u003e\nCc: Oleg Nesterov \u003coleg@tv-sign.ru\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": "2d38b1a7466251bded8a45d01d41cca577cf40b1",
      "old_mode": 33188,
      "old_path": "include/linux/freezer.h",
      "new_id": "c8e02de737f6b07a3443d53362aee0d3bc507087",
      "new_mode": 33188,
      "new_path": "include/linux/freezer.h"
    },
    {
      "type": "modify",
      "old_id": "e8af8d0c2483232248ba163dc0e9eb03ad6ed504",
      "old_mode": 33188,
      "old_path": "kernel/exit.c",
      "new_id": "464c2b172f07477ca27a453edcf93fb6eeebe1c6",
      "new_mode": 33188,
      "new_path": "kernel/exit.c"
    },
    {
      "type": "modify",
      "old_id": "b850173e7561058e768675f3a11d04087a185999",
      "old_mode": 33188,
      "old_path": "kernel/power/process.c",
      "new_id": "e1bcdedd1464046204e4347489803d990547cc0c",
      "new_mode": 33188,
      "new_path": "kernel/power/process.c"
    }
  ]
}
