sched: Rework check_for_tasks()
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 <e5b39230c99b4d3ebd6aa54f6d823f95134bc39d@parallels.com>
Reviewed-by: Srikar Dronamraju <1f69195f6d934d4caf5816234bde319316df237e@linux.vnet.ibm.com>
Cc: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Cc: Ben Segall <7dc6b67dc6a1a2319718815cbe6519298041ac95@google.com>
Cc: Fabian Frederick <3efd2a027b14fd890cd23a9ef6d1134b4e5ad850@skynet.be>
Cc: Gautham R. Shenoy <c13571dbffa0eb89c7f8eebdce482897b0f5a685@linux.vnet.ibm.com>
Cc: Konstantin Khorenko <911e0b25dd7021a69585f86d9f602377d41d15aa@parallels.com>
Cc: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>
Cc: Michael wang <6affa2782fb8514898f88c7c4a087191fcbabb20@linux.vnet.ibm.com>
Cc: Mike Galbraith <d1e2fad1f6337a0a3a08db0a5375a8a96150db4c@gmail.com>
Cc: Paul Gortmaker <ae947f3c8df96e1dc851c5e3e5a930ce6d3f1f74@windriver.com>
Cc: Paul Turner <56b59ac50e86208fd62726b53c1d890b9a8ff058@google.com>
Cc: Rafael J. Wysocki <27ffc44a8ec6a212fba98cfc3246c6ce8ab131e0@intel.com>
Cc: Srivatsa S. Bhat <5b23f8226e886b22344fc642373ea657dd596b63@linux.vnet.ibm.com>
Cc: Todd E Brandt <8da30c6e5270f3ec55b7f431aadf4dbb2152d8e9@linux.intel.com>
Cc: Toshi Kani <322b9f75d3806917607539efc168804d71b9503d@hp.com>
Signed-off-by: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Link: 135b1145cd8abd4ae2d52b397b80ad0b32788bca@tkhai
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs