ARM64: sched: fix bug: remove printk while schedule is in progress
authorChen Liang <cl@rock-chips.com>
Fri, 8 Jul 2016 02:37:53 +0000 (10:37 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 8 Jul 2016 06:25:13 +0000 (14:25 +0800)
commit9aa987e46128bc063765af2a720561256cd69e32
tree11328cd44b3913e4eac8e07fca092ed86dc1b9f9
parent649f8c0d9aa08d8c9a04cc1a1412cdf2a4836bca
ARM64: sched: fix bug: remove printk while schedule is in progress

It will cause deadlock and while(1) if call printk while schedule
is in progress. The block state like as below:

cpu0(hold the console sem):
printk->console_unlock->up_sem->spin_lock(&sem->lock)->wake_up_process(cpu1)
->try_to_wake_up(cpu1)->while(p->on_cpu).

cpu1(request console sem):
console_lock->down_sem->schedule->idle_banlance->update_cpu_capacity->
printk->console_trylock->spin_lock(&sem->lock).

p->on_cpu will be 1 forever, because the task is still running on cpu1,
so cpu0 is blocked in while(p->on_cpu), but cpu1 could not get
spin_lock(&sem->lock), it is blocked too, it means the task will running
on cpu1 forever.

Change-Id: I60d02d8c957273872f97939632bdd235accdad4e
Signed-off-by: Chen Liang <cl@rock-chips.com>
kernel/sched/fair.c