1. 29 Oct, 2012 3 commits
    • Frederic Weisbecker's avatar
      kvm: Directly account vtime to system on guest switch · b080935c
      Frederic Weisbecker authored
      Switching to or from guest context is done on ioctl context.
      So by the time we call kvm_guest_enter() or kvm_guest_exit()
      we know we are not running the idle task.
      
      As a result, we can directly account the cputime using
      vtime_account_system().
      
      There are two good reasons to do this:
      
      * We avoid some useless checks on guest switch. It optimizes
      a bit this fast path.
      
      * In the case of CONFIG_IRQ_TIME_ACCOUNTING, calling vtime_account()
      checks for irq time to account. This is pointless since we know
      we are not in an irq on guest switch. This is wasting cpu cycles
      for no good reason. vtime_account_system() OTOH is a no-op in
      this config option.
      
      * We can remove the irq disable/enable around kvm guest switch in s390.
      
      A further optimization may consist in introducing a vtime_account_guest()
      that directly calls account_guest_time().
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Xiantao Zhang <xiantao.zhang@intel.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.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>
      b080935c
    • Frederic Weisbecker's avatar
      vtime: Make vtime_account_system() irqsafe · 11113334
      Frederic Weisbecker authored
      vtime_account_system() currently has only one caller with
      vtime_account() which is irq safe.
      
      Now we are going to call it from other places like kvm where
      irqs are not always disabled by the time we account the cputime.
      
      So let's make it irqsafe. The arch implementation part is now
      prefixed with "__".
      
      vtime_account_idle() arch implementation is prefixed accordingly
      to stay consistent.
      Signed-off-by: default avatarFrederic 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>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      11113334
    • Frederic Weisbecker's avatar
      vtime: Gather vtime declarations to their own header file · dcbf832e
      Frederic Weisbecker authored
      These APIs are scattered around and are going to expand a bit.
      Let's create a dedicated header file for sanity.
      Signed-off-by: default avatarFrederic 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>
      dcbf832e
  2. 24 Oct, 2012 24 commits
  3. 23 Oct, 2012 13 commits