From: Kirill Tkhai Date: Wed, 25 Jun 2014 08:19:55 +0000 (+0400) Subject: sched: Rework check_for_tasks() X-Git-Tag: omap-for-v3.17/fixes-against-rc2~177^2~13 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b728ca06029d085a1585c1926610f26de93b9146;p=pandora-kernel.git sched: Rework check_for_tasks() 1) Iterate thru all of threads in the system. Check for all threads, not only for group leaders. 2) Check for p->on_rq instead of p->state and cputime. Preempted task in !TASK_RUNNING state OR just created task may be queued, that we want to be reported too. 3) Use read_lock() instead of write_lock(). This function does not change any structures, and read_lock() is enough. Signed-off-by: Kirill Tkhai Reviewed-by: Srikar Dronamraju Cc: Andrew Morton Cc: Ben Segall Cc: Fabian Frederick Cc: Gautham R. Shenoy Cc: Konstantin Khorenko Cc: Linus Torvalds Cc: Michael wang Cc: Mike Galbraith Cc: Paul Gortmaker Cc: Paul Turner Cc: Rafael J. Wysocki Cc: Srivatsa S. Bhat Cc: Todd E Brandt Cc: Toshi Kani Signed-off-by: Peter Zijlstra Link: http://lkml.kernel.org/r/1403684395.3462.44.camel@tkhai Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed