)]}'
{
  "commit": "f2530dc71cf0822f90bb63ea4600caaef33a66bb",
  "tree": "182473ca3a295cdbd907826aa22bae94c52fa486",
  "parents": [
    "cfb63bafdb87bbcdc5d6dbbca623d3f69475f118"
  ],
  "author": {
    "name": "Thomas Gleixner",
    "email": "tglx@linutronix.de",
    "time": "Tue Apr 09 09:33:34 2013 +0200"
  },
  "committer": {
    "name": "Thomas Gleixner",
    "email": "tglx@linutronix.de",
    "time": "Fri Apr 12 14:18:43 2013 +0200"
  },
  "message": "kthread: Prevent unpark race which puts threads on the wrong cpu\n\nThe smpboot threads rely on the park/unpark mechanism which binds per\ncpu threads on a particular core. Though the functionality is racy:\n\nCPU0\t       \t \tCPU1  \t     \t    CPU2\nunpark(T)\t\t\t\t    wake_up_process(T)\n  clear(SHOULD_PARK)\tT runs\n\t\t\tleave parkme() due to !SHOULD_PARK  \n  bind_to(CPU2)\t\tBUG_ON(wrong CPU)\t\t\t\t\t\t    \n\nWe cannot let the tasks move themself to the target CPU as one of\nthose tasks is actually the migration thread itself, which requires\nthat it starts running on the target cpu right away.\n\nThe solution to this problem is to prevent wakeups in park mode which\nare not from unpark(). That way we can guarantee that the association\nof the task to the target cpu is working correctly.\n\nAdd a new task state (TASK_PARKED) which prevents other wakeups and\nuse this state explicitly for the unpark wakeup.\n\nPeter noticed: Also, since the task state is visible to userspace and\nall the parked tasks are still in the PID space, its a good hint in ps\nand friends that these tasks aren\u0027t really there for the moment.\n\nThe migration thread has another related issue.\n\nCPU0\t      \t     \t CPU1\nBring up CPU2\ncreate_thread(T)\npark(T)\n wait_for_completion()\n\t\t\t parkme()\n\t\t\t complete()\nsched_set_stop_task()\n\t\t\t schedule(TASK_PARKED)\n\nThe sched_set_stop_task() call is issued while the task is on the\nrunqueue of CPU1 and that confuses the hell out of the stop_task class\non that cpu. So we need the same synchronizaion before\nsched_set_stop_task().\n\nReported-by: Dave Jones \u003cdavej@redhat.com\u003e\nReported-and-tested-by: Dave Hansen \u003cdave@sr71.net\u003e\nReported-and-tested-by: Borislav Petkov \u003cbp@alien8.de\u003e\nAcked-by: Peter Ziljstra \u003cpeterz@infradead.org\u003e\nCc: Srivatsa S. Bhat \u003csrivatsa.bhat@linux.vnet.ibm.com\u003e\nCc: dhillf@gmail.com\nCc: Ingo Molnar \u003cmingo@kernel.org\u003e\nCc: stable@vger.kernel.org\nLink: http://lkml.kernel.org/r/alpine.LFD.2.02.1304091635430.21884@ionos\nSigned-off-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f7ed9ee46eb9d3818d2210c100731e5eda6ee35e",
      "old_mode": 33188,
      "old_path": "fs/proc/array.c",
      "new_id": "cbd0f1b324b972b96f036139fcd96bf53a03fb01",
      "new_mode": 33188,
      "new_path": "fs/proc/array.c"
    },
    {
      "type": "modify",
      "old_id": "d35d2b6ddbfb69f098b1660fe280b4d2da8a5ffe",
      "old_mode": 33188,
      "old_path": "include/linux/sched.h",
      "new_id": "e692a022527bdaaace8b388268b0c280946fc5c2",
      "new_mode": 33188,
      "new_path": "include/linux/sched.h"
    },
    {
      "type": "modify",
      "old_id": "5a8671e8a67ff8fa8f715311300901181555d78e",
      "old_mode": 33188,
      "old_path": "include/trace/events/sched.h",
      "new_id": "e5586caff67a973c962a3ed6bf43d4cc01664083",
      "new_mode": 33188,
      "new_path": "include/trace/events/sched.h"
    },
    {
      "type": "modify",
      "old_id": "691dc2ef9baf241c121144799360a7e1237afcb5",
      "old_mode": 33188,
      "old_path": "kernel/kthread.c",
      "new_id": "9eb7fed0bbaa9895973a14e551c76de31fffe533",
      "new_mode": 33188,
      "new_path": "kernel/kthread.c"
    },
    {
      "type": "modify",
      "old_id": "8eaed9aa9cf0c1995520605af1de8ef3b9e95485",
      "old_mode": 33188,
      "old_path": "kernel/smpboot.c",
      "new_id": "02fc5c9336735a834378dbbb6fff8e57b919b0fa",
      "new_mode": 33188,
      "new_path": "kernel/smpboot.c"
    }
  ]
}
