Skip to content

Commit 7621d1f

Browse files
committed
vtime: Remove a few unneeded generic vtime state checks
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>
1 parent 1b6a259 commit 7621d1f

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

‎kernel/sched/cputime.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -664,9 +664,6 @@ static void __vtime_account_system(struct task_struct *tsk)
664664

665665
void vtime_account_system(struct task_struct *tsk)
666666
{
667-
if (!vtime_accounting_enabled())
668-
return;
669-
670667
write_seqlock(&tsk->vtime_seqlock);
671668
__vtime_account_system(tsk);
672669
write_sequnlock(&tsk->vtime_seqlock);
@@ -686,12 +683,7 @@ void vtime_account_irq_exit(struct task_struct *tsk)
686683

687684
void vtime_account_user(struct task_struct *tsk)
688685
{
689-
cputime_t delta_cpu;
690-
691-
if (!vtime_accounting_enabled())
692-
return;
693-
694-
delta_cpu = get_vtime_delta(tsk);
686+
cputime_t delta_cpu = get_vtime_delta(tsk);
695687

696688
write_seqlock(&tsk->vtime_seqlock);
697689
tsk->vtime_snap_whence = VTIME_SYS;
@@ -701,9 +693,6 @@ void vtime_account_user(struct task_struct *tsk)
701693

702694
void vtime_user_enter(struct task_struct *tsk)
703695
{
704-
if (!vtime_accounting_enabled())
705-
return;
706-
707696
write_seqlock(&tsk->vtime_seqlock);
708697
tsk->vtime_snap_whence = VTIME_USER;
709698
__vtime_account_system(tsk);

0 commit comments

Comments
 (0)