Cputime cleanups and optimizations:

* Gather vtime headers that were a bit scattered around

* Separate irqtime and vtime namespaces that were
colliding, resulting in useless calls to irqtime accounting.

* Slightly optimize irq and guest vtime accounting.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAABAgAGBQJQjw0PAAoJEIUkVEdQjox3eAQQALjK9iYZLHjLKEr6bzE57IyW
9HnLVxOVpMRQI808MIv6rVefKxnG6Z4o6xRhYvIxy2a+nlv3dtRjIMOoSvXEY3XL
kKMrqzriJ0fPZxUUmUxL96KH+3Z39AOymQ4R+QhSx2Xix95hxVIGlSyx9i3oU2mY
Z5JCBinRWQOS3snHHmHWbD5Igx8246HP61Z1Io7+KpzBzMUINizLBXyD3RN6h4KF
pLFnIjcRSz/SZZWk78ksak5m/LW9ZZiXrn3pgPU4IKa5vd/P2YuRZWOwa/AgXF8g
OENGmcWh22TAb0ONFgOetGNOe1GrEnRMSRCruiazJAXmxJYeuXlx38iTGzIF+Kl/
9a+Uktb7rFKOE6v0Q6oawSe59zev5lZdHFOQNhnNC1HJoBtFFLAYQ4YgRs/W4ppt
0GjNIz2hUW2Ay1Sr1uZeA9EFFH8K/XBCgI9m1yxfGmeuFuSDLyTg61CrxFBACDnK
ZCNM7xhoHU0+nmC+UULB7XQat4LnVf4c+7WcVUCPedecR2Enk9d1gToY1n9HQE9q
RQJjIONScaEhppaaCasCXnhLQoCkH041NeSmf6BT6JwS5j7d3+0qq24I1yoBfwcb
bQagP+RltkTuxSLH7k9jMP0ISNeObtdeP/ahAmoQeXA0yMgMMOvkVQhdW4yRSufD
SrKKL3vR2MfhCbmjUuAQ
=mKGl
-----END PGP SIGNATURE-----
cputime: Separate irqtime accounting from generic vtime

vtime_account() doesn't have the same role in
CONFIG_VIRT_CPU_ACCOUNTING and CONFIG_IRQ_TIME_ACCOUNTING.

In the first case it handles time accounting in any context. In
the second case it only handles irq time accounting.

So when vtime_account() is called from outside vtime_account_irq_*()
this call is pointless to CONFIG_IRQ_TIME_ACCOUNTING.

To fix the confusion, change vtime_account() to irqtime_account_irq()
in CONFIG_IRQ_TIME_ACCOUNTING. This way we ensure future account_vtime()
calls won't waste useless cycles in the irqtime APIs.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
2 files changed