{"push_id":1082978463,"size":1,"distinct_size":1,"ref":"refs/heads/cm-13.0","head":"f38506bce1ee76750897f266ddb3a1abcdae0937","before":"6eed0c6b6aa317fb7f440d4fb73c7c621f7aa368","commits":[{"sha":"f38506bce1ee76750897f266ddb3a1abcdae0937","author":{"email":"69d4c67d027719823df1f8f9226c47bc05dc8998@codeaurora.org","name":"Srivatsa Vaddagiri"},"message":"cpufreq: cpu-boost: Resolve deadlock when waking up sync thread\n\nCPU boost driver receives notification from scheduler when threads\nmigrate towards a cpu and in turn wakes up a sync thread associated\nwith that cpu to handle any required frequency transitions. The wakeup\ncall however can lead to a deadlock inside scheduler under some\ncircumstance. The deadlock is seen when sync thread is the only thread\nrunning on a cpu and goes to sleep (say by calling wait_event() ->\nschedule()). Midway through this sleep (schedule()) call, while cpu is\nstill running in context of sync thread, scheduler attempts a load\nbalance (realizing that cpu is about to become idle) which can result\nin tasks being migrated towards the cpu going idle. This will cause\nmigration notification to be issued and in turn a wakeup on sync\nthread. The wakeup call however gets stuck in below while() loop\ninside scheduler:\n\ntry_to_wake_up(struct task_struct *p, ...)\n{\n\n        /*\n         * If the owning (remote) cpu is still in the middle of\n\t * schedule() with this task as prev, wait until its done\n\t * referencing the task.\n         */\n\twhile (p->on_cpu)\n\t\tcpu_relax();\n\n}\n\nA possible fix could be to teach try_to_wake_up() about this\nspecial case. Another fix, implemented in this patch and that helps\nminimize scheduler changes, is to have cpu boost driver not issue a\nwakeup under this special circumstance, which was found to occur very\ninfrequently.\n\nChange-Id: I92bc68a22d51595a208673fe2a1eedfa97004f9e\nSigned-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>","distinct":true,"url":"https://api.github.com/repos/CyanogenMod/android_kernel_motorola_ghost/commits/f38506bce1ee76750897f266ddb3a1abcdae0937"}]}