summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSaravana Kannan <skannan@codeaurora.org>2014-01-28 19:40:32 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 19:58:44 -0700
commit2f97ec6d6edc15410a38738dc21674e2bf020f13 (patch)
treefeb4d450c38a6c2c8c533edaed5eed2dc88c78fa /include
parent6f13a3351a4c06f89ea7954aae69e5aaf0cea3b0 (diff)
cpufreq: cpu-boost: Fix deadlock in wake_up of sync threads
If wake_up() is called on the current task on a CPU, the call will wait until the current task is switched out before it wakes it up again and returns. The sync notifier for a CPU always runs on that CPU. These two together can result in a deadlock if the sync notifier on CPU A tries to wake up the sync thread of CPU A as it goes to sleep (is the current task). A previous commit fixed this by adding a check to the sync notifier to not wake up the sync thread of CPU A if it's the current task. But this is still not sufficient to prevent deadlocks. Sync thread of CPU A could be the current task on CPU B and sync thread of CPU B could be the current task on CPU A. At this point, if sync notifier of CPU A and B try to wake up the sync threads of CPU A and B, it will result in CPU A waiting for the current task in CPU B to get switched out and CPU B waiting for the current task in CPU A to get switched out. This will result in a deadlock. Prevent this scenario from happening by pinning the sync threads of each CPU to run on that CPU. By doing this, we guarantee that sync notifiers will only try to wake up sync threads running on that CPU. The fix added by "cpufreq: cpu-boost: Resolve deadlock when waking up sync thread" ensures a deadlock doesn't happen when a sync notifier tries to wake up a sync thread running on that CPU. Change-Id: I864e545529722a23886dd5a82f66089155d2d193 Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions