)]}'
{
  "commit": "c27711dc7f2cff89cee6a47026d936672cb29350",
  "tree": "e5a0ec57b1bd91a803be48854467b70091c2bdc6",
  "parents": [
    "32c4490a6ffbe3de604581f5fdce361eb049acff"
  ],
  "author": {
    "name": "Chanho Min",
    "email": "chanho0207@gmail.com",
    "time": "Thu Jan 05 20:00:19 2012 +0900"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Mon Feb 13 11:06:08 2012 -0800"
  },
  "message": "sched/rt: Fix task stack corruption under __ARCH_WANT_INTERRUPTS_ON_CTXSW\n\ncommit cb297a3e433dbdcf7ad81e0564e7b804c941ff0d upstream.\n\nThis issue happens under the following conditions:\n\n 1. preemption is off\n 2. __ARCH_WANT_INTERRUPTS_ON_CTXSW is defined\n 3. RT scheduling class\n 4. SMP system\n\nSequence is as follows:\n\n 1.suppose current task is A. start schedule()\n 2.task A is enqueued pushable task at the entry of schedule()\n   __schedule\n    prev \u003d rq-\u003ecurr;\n    ...\n    put_prev_task\n     put_prev_task_rt\n      enqueue_pushable_task\n 4.pick the task B as next task.\n   next \u003d pick_next_task(rq);\n 3.rq-\u003ecurr set to task B and context_switch is started.\n   rq-\u003ecurr \u003d next;\n 4.At the entry of context_swtich, release this cpu\u0027s rq-\u003elock.\n   context_switch\n    prepare_task_switch\n     prepare_lock_switch\n      raw_spin_unlock_irq(\u0026rq-\u003elock);\n 5.Shortly after rq-\u003elock is released, interrupt is occurred and start IRQ context\n 6.try_to_wake_up() which called by ISR acquires rq-\u003elock\n    try_to_wake_up\n     ttwu_remote\n      rq \u003d __task_rq_lock(p)\n      ttwu_do_wakeup(rq, p, wake_flags);\n        task_woken_rt\n 7.push_rt_task picks the task A which is enqueued before.\n   task_woken_rt\n    push_rt_tasks(rq)\n     next_task \u003d pick_next_pushable_task(rq)\n 8.At find_lock_lowest_rq(), If double_lock_balance() returns 0,\n   lowest_rq can be the remote rq.\n  (But,If preemption is on, double_lock_balance always return 1 and it\n   does\u0027t happen.)\n   push_rt_task\n    find_lock_lowest_rq\n     if (double_lock_balance(rq, lowest_rq))..\n 9.find_lock_lowest_rq return the available rq. task A is migrated to\n   the remote cpu/rq.\n   push_rt_task\n    ...\n    deactivate_task(rq, next_task, 0);\n    set_task_cpu(next_task, lowest_rq-\u003ecpu);\n    activate_task(lowest_rq, next_task, 0);\n 10. But, task A is on irq context at this cpu.\n     So, task A is scheduled by two cpus at the same time until restore from IRQ.\n     Task A\u0027s stack is corrupted.\n\nTo fix it, don\u0027t migrate an RT task if it\u0027s still running.\n\nSigned-off-by: Chanho Min \u003cchanho.min@lge.com\u003e\nSigned-off-by: Peter Zijlstra \u003ca.p.zijlstra@chello.nl\u003e\nAcked-by: Steven Rostedt \u003crostedt@goodmis.org\u003e\nLink: http://lkml.kernel.org/r/CAOAMb1BHA\u003d5fm7KTewYyke6u-8DP0iUuJMpgQw54vNeXFsGpoQ@mail.gmail.com\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "17f2319d5e4f601f3b1432910bf942fe42548592",
      "old_mode": 33188,
      "old_path": "kernel/sched_rt.c",
      "new_id": "ac79f9e34fd2a877c26aad4cc9268dbd2a6259a0",
      "new_mode": 33188,
      "new_path": "kernel/sched_rt.c"
    }
  ]
}
