vtime: Remove a few unneeded generic vtime state checks
authorFrederic Weisbecker <fweisbec@gmail.com>
Sat, 13 Jul 2013 15:07:35 +0000 (17:07 +0200)
committerFrederic Weisbecker <fweisbec@gmail.com>
Wed, 14 Aug 2013 15:14:49 +0000 (17:14 +0200)
Some generic vtime APIs check if the vtime accounting
is enabled on the local CPU before doing their work.

Some of these are not needed because all their callers already
take care of that. Let's remove the checks on these.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Kevin Hilman <khilman@linaro.org>
kernel/sched/cputime.c

index bb6b29a3067cf2a9069a458e5ee5bfd0c9347126..5f273b47776455a868c058074e07ae699f37e27b 100644 (file)
@@ -664,9 +664,6 @@ static void __vtime_account_system(struct task_struct *tsk)
 
 void vtime_account_system(struct task_struct *tsk)
 {
-       if (!vtime_accounting_enabled())
-               return;
-
        write_seqlock(&tsk->vtime_seqlock);
        __vtime_account_system(tsk);
        write_sequnlock(&tsk->vtime_seqlock);
@@ -686,12 +683,7 @@ void vtime_account_irq_exit(struct task_struct *tsk)
 
 void vtime_account_user(struct task_struct *tsk)
 {
-       cputime_t delta_cpu;
-
-       if (!vtime_accounting_enabled())
-               return;
-
-       delta_cpu = get_vtime_delta(tsk);
+       cputime_t delta_cpu = get_vtime_delta(tsk);
 
        write_seqlock(&tsk->vtime_seqlock);
        tsk->vtime_snap_whence = VTIME_SYS;
@@ -701,9 +693,6 @@ void vtime_account_user(struct task_struct *tsk)
 
 void vtime_user_enter(struct task_struct *tsk)
 {
-       if (!vtime_accounting_enabled())
-               return;
-
        write_seqlock(&tsk->vtime_seqlock);
        tsk->vtime_snap_whence = VTIME_USER;
        __vtime_account_system(tsk);