]> www.infradead.org Git - users/jedix/linux-maple.git/commit
irqtime: Make accounting correct on RT
authorThomas Gleixner <tglx@linutronix.de>
Tue, 9 Mar 2021 08:55:54 +0000 (09:55 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 6 Apr 2021 23:07:13 +0000 (16:07 -0700)
commitf8de104bd1bd77b3381920e54cc01603825f60b8
treeee7b004e52f02ab4704750800664d0c44f32df24
parentec828e4e684a396cba48b53d548bb0bd9ad7de1b
irqtime: Make accounting correct on RT

vtime_account_irq and irqtime_account_irq() base checks on preempt_count()
which fails on RT because preempt_count() does not contain the softirq
accounting which is seperate on RT.

These checks do not need the full preempt count as they only operate on the
hard and softirq sections.

Use irq_count() instead which provides the correct value on both RT and non
RT kernels. The compiler is clever enough to fold the masking for !RT:

       99b: 65 8b 05 00 00 00 00  mov    %gs:0x0(%rip),%eax
 -     9a2: 25 ff ff ff 7f        and    $0x7fffffff,%eax
 +     9a2: 25 00 ff ff 00        and    $0xffff00,%eax

Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/sched/cputime.c