posix_cpu_timer: Check thread timers only when there are active thread timers
posix_cpu_timer: Check thread timers only when there are active thread timers

The fastpath_timer_check() contains logic to check for if any timers
are set by checking if !task_cputime_zero(). Similarly, we can do this
before calling check_thread_timers(). In the case where there
are only process-wide timers, this will skip all of the computations for
per-thread timers when there are no per-thread timers.

As suggested by George, we can put the task_cputime_zero() check in
check_thread_timers(), since that is more of an optization to the
function. Similarly, we move the existing check of cputimer->running
to check_process_timers().

Signed-off-by: Jason Low <09ebf12aa4fd61769490ade56a7655bcf429b765@hp.com>
Reviewed-by: Oleg Nesterov <20b70f0af00562e63758b9ee42012ecc96c58590@redhat.com>
Reviewed-by: George Spelvin <ba324ca7b1c77fc20bb970d5aff6eea9377918a5@horizon.com>
Cc: Paul E. McKenney <1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <e8a1bf9163cb25e93cfd6540f223b3872ea7ee55@gmail.com>
Cc: Davidlohr Bueso <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@stgolabs.net>
Cc: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>
Cc: cf19071d20d0489cc273cc5f1e3c68b76990e35e@hpe.com
Cc: 82d105e0cd7d24139806dfe077064e2db31cea16@hpe.com
Cc: 49115ac805b6db5f3b6f48b0e88b39699dd1bea1@hpe.com
Cc: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Link: http://lkml.kernel.org/r/1444849677-29330-3-git-send-email-09ebf12aa4fd61769490ade56a7655bcf429b765@hp.com
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

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