summaryrefslogtreecommitdiff
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-10-30 08:33:01 +0100
committerIngo Molnar <mingo@kernel.org>2012-10-30 08:33:01 +0100
commit38ca9c927c7d3db61f57e3d3a9334958c3af6e9a (patch)
tree58be18cf3dce7a407c84ab2532e92bdb8b7ee067 /include/linux/kvm_host.h
parente9c84cb8d5f1b1ea6fcbe6190d51dc84b6975938 (diff)
parent3e1df4f506836e6bea1ab61cf88c75c8b1840643 (diff)
Merge tag 'cputime-cleanups-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into sched/core
Pull cputime cleanups and optimizations from Frederic Weisbecker: * 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> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 93bfc9f9815c..0e2212fe4784 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -737,7 +737,11 @@ static inline int kvm_deassign_device(struct kvm *kvm,
static inline void kvm_guest_enter(void)
{
BUG_ON(preemptible());
- vtime_account(current);
+ /*
+ * This is running in ioctl context so we can avoid
+ * the call to vtime_account() with its unnecessary idle check.
+ */
+ vtime_account_system(current);
current->flags |= PF_VCPU;
/* KVM does not hold any references to rcu protected data when it
* switches CPU into a guest mode. In fact switching to a guest mode
@@ -751,7 +755,11 @@ static inline void kvm_guest_enter(void)
static inline void kvm_guest_exit(void)
{
- vtime_account(current);
+ /*
+ * This is running in ioctl context so we can avoid
+ * the call to vtime_account() with its unnecessary idle check.
+ */
+ vtime_account_system(current);
current->flags &= ~PF_VCPU;
}