• Frederic Weisbecker's avatar
    sched/cputime, ia64: Accumulate cputime and account only on tick/task switch · 7dd58230
    Frederic Weisbecker authored
    Currently CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y accounts the cputime on
    any context boundary: irq entry/exit, guest entry/exit, context switch,
    etc...
    
    Calling functions such as account_system_time(), account_user_time()
    and such can be costly, especially if they are called on many fastpath
    such as twice per IRQ. Those functions do more than just accounting to
    kcpustat and task cputime. Depending on the config, some subsystems can
    perform unpleasant multiplications and divisions, among other things.
    
    So lets accumulate the cputime instead and delay the accounting on ticks
    and context switches only.
    Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
    Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: Christian Borntraeger <borntraeger@de.ibm.com>
    Cc: Fenghua Yu <fenghua.yu@intel.com>
    Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Stanislaw Gruszka <sgruszka@redhat.com>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Wanpeng Li <wanpeng.li@hotmail.com>
    Link: http://lkml.kernel.org/r/1483636310-6557-9-git-send-email-fweisbec@gmail.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    7dd58230
thread_info.h 4.63 KB