Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d9ac79d8 authored by Caesar Wang's avatar Caesar Wang Committed by Wei Wang
Browse files

sched/fair: 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: I61f5633b5e8dfa4fb6bac801dc1732a5494a0a88
Signed-off-by: default avatarCaesar Wang <wxt@rock-chips.com>
Git-commit: df232437710122fcb4e4a0484a1eded5aec29a6a
Git-repo: https://android.googlesource.com/kernel/msm


Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 954332d4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment