1. 28 5月, 2015 1 次提交
  2. 26 5月, 2015 4 次提交
  3. 20 5月, 2015 1 次提交
    • P
      KVM: export __gfn_to_pfn_memslot, drop gfn_to_pfn_async · 3520469d
      Paolo Bonzini 提交于
      gfn_to_pfn_async is used in just one place, and because of x86-specific
      treatment that place will need to look at the memory slot.  Hence inline
      it into try_async_pf and export __gfn_to_pfn_memslot.
      
      The patch also switches the subsequent call to gfn_to_pfn_prot to use
      __gfn_to_pfn_memslot.  This is a small optimization.  Finally, remove
      the now-unused async argument of __gfn_to_pfn.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3520469d
  4. 08 5月, 2015 2 次提交
  5. 21 4月, 2015 1 次提交
    • P
      KVM: PPC: Book3S HV: Create debugfs file for each guest's HPT · e23a808b
      Paul Mackerras 提交于
      This creates a debugfs directory for each HV guest (assuming debugfs
      is enabled in the kernel config), and within that directory, a file
      by which the contents of the guest's HPT (hashed page table) can be
      read.  The directory is named vmnnnn, where nnnn is the PID of the
      process that created the guest.  The file is named "htab".  This is
      intended to help in debugging problems in the host's management
      of guest memory.
      
      The contents of the file consist of a series of lines like this:
      
        3f48 4000d032bf003505 0000000bd7ff1196 00000003b5c71196
      
      The first field is the index of the entry in the HPT, the second and
      third are the HPT entry, so the third entry contains the real page
      number that is mapped by the entry if the entry's valid bit is set.
      The fourth field is the guest's view of the second doubleword of the
      entry, so it contains the guest physical address.  (The format of the
      second through fourth fields are described in the Power ISA and also
      in arch/powerpc/include/asm/mmu-hash64.h.)
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      e23a808b
  6. 10 4月, 2015 1 次提交
  7. 08 4月, 2015 1 次提交
  8. 01 4月, 2015 1 次提交
  9. 27 3月, 2015 2 次提交
  10. 24 3月, 2015 1 次提交
    • I
      kvm: avoid page allocation failure in kvm_set_memory_region() · 74496134
      Igor Mammedov 提交于
      KVM guest can fail to startup with following trace on host:
      
      qemu-system-x86: page allocation failure: order:4, mode:0x40d0
      Call Trace:
        dump_stack+0x47/0x67
        warn_alloc_failed+0xee/0x150
        __alloc_pages_direct_compact+0x14a/0x150
        __alloc_pages_nodemask+0x776/0xb80
        alloc_kmem_pages+0x3a/0x110
        kmalloc_order+0x13/0x50
        kmemdup+0x1b/0x40
        __kvm_set_memory_region+0x24a/0x9f0 [kvm]
        kvm_set_ioapic+0x130/0x130 [kvm]
        kvm_set_memory_region+0x21/0x40 [kvm]
        kvm_vm_ioctl+0x43f/0x750 [kvm]
      
      Failure happens when attempting to allocate pages for
      'struct kvm_memslots', however it doesn't have to be
      present in physically contiguous (kmalloc-ed) address
      space, change allocation to kvm_kvzalloc() so that
      it will be vmalloc-ed when its size is more then a page.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      74496134
  11. 19 3月, 2015 1 次提交
  12. 11 3月, 2015 1 次提交
  13. 10 3月, 2015 11 次提交
  14. 12 2月, 2015 1 次提交
  15. 09 2月, 2015 1 次提交
  16. 06 2月, 2015 1 次提交
    • P
      kvm: add halt_poll_ns module parameter · f7819512
      Paolo Bonzini 提交于
      This patch introduces a new module parameter for the KVM module; when it
      is present, KVM attempts a bit of polling on every HLT before scheduling
      itself out via kvm_vcpu_block.
      
      This parameter helps a lot for latency-bound workloads---in particular
      I tested it with O_DSYNC writes with a battery-backed disk in the host.
      In this case, writes are fast (because the data doesn't have to go all
      the way to the platters) but they cannot be merged by either the host or
      the guest.  KVM's performance here is usually around 30% of bare metal,
      or 50% if you use cache=directsync or cache=writethrough (these
      parameters avoid that the guest sends pointless flush requests, and
      at the same time they are not slow because of the battery-backed cache).
      The bad performance happens because on every halt the host CPU decides
      to halt itself too.  When the interrupt comes, the vCPU thread is then
      migrated to a new physical CPU, and in general the latency is horrible
      because the vCPU thread has to be scheduled back in.
      
      With this patch performance reaches 60-65% of bare metal and, more
      important, 99% of what you get if you use idle=poll in the guest.  This
      means that the tunable gets rid of this particular bottleneck, and more
      work can be done to improve performance in the kernel or QEMU.
      
      Of course there is some price to pay; every time an otherwise idle vCPUs
      is interrupted by an interrupt, it will poll unnecessarily and thus
      impose a little load on the host.  The above results were obtained with
      a mostly random value of the parameter (500000), and the load was around
      1.5-2.5% CPU usage on one of the host's core for each idle guest vCPU.
      
      The patch also adds a new stat, /sys/kernel/debug/kvm/halt_successful_poll,
      that can be used to tune the parameter.  It counts how many HLT
      instructions received an interrupt during the polling period; each
      successful poll avoids that Linux schedules the VCPU thread out and back
      in, and may also avoid a likely trip to C1 and back for the physical CPU.
      
      While the VM is idle, a Linux 4 VCPU VM halts around 10 times per second.
      Of these halts, almost all are failed polls.  During the benchmark,
      instead, basically all halts end within the polling period, except a more
      or less constant stream of 50 per second coming from vCPUs that are not
      running the benchmark.  The wasted time is thus very low.  Things may
      be slightly different for Windows VMs, which have a ~10 ms timer tick.
      
      The effect is also visible on Marcelo's recently-introduced latency
      test for the TSC deadline timer.  Though of course a non-RT kernel has
      awful latency bounds, the latency of the timer is around 8000-10000 clock
      cycles compared to 20000-120000 without setting halt_poll_ns.  For the TSC
      deadline timer, thus, the effect is both a smaller average latency and
      a smaller variance.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f7819512
  17. 29 1月, 2015 1 次提交
  18. 28 1月, 2015 1 次提交
  19. 16 1月, 2015 2 次提交
  20. 09 1月, 2015 1 次提交
  21. 28 12月, 2014 2 次提交
  22. 04 12月, 2014 2 次提交
    • C
      KVM: track pid for VCPU only on KVM_RUN ioctl · 7a72f7a1
      Christian Borntraeger 提交于
      We currently track the pid of the task that runs the VCPU in vcpu_load.
      If a yield to that VCPU is triggered while the PID of the wrong thread
      is active, the wrong thread might receive a yield, but this will most
      likely not help the executing thread at all.  Instead, if we only track
      the pid on the KVM_RUN ioctl, there are two possibilities:
      
      1) the thread that did a non-KVM_RUN ioctl is holding a mutex that
      the VCPU thread is waiting for.  In this case, the VCPU thread is not
      runnable, but we also do not do a wrong yield.
      
      2) the thread that did a non-KVM_RUN ioctl is sleeping, or doing
      something that does not block the VCPU thread.  In this case, the
      VCPU thread can receive the directed yield correctly.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      CC: Rik van Riel <riel@redhat.com>
      CC: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
      CC: Michael Mueller <mimu@linux.vnet.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7a72f7a1
    • D
      KVM: don't check for PF_VCPU when yielding · eed6e79d
      David Hildenbrand 提交于
      kvm_enter_guest() has to be called with preemption disabled and will
      set PF_VCPU.  Current code takes PF_VCPU as a hint that the VCPU thread
      is running and therefore needs no yield.
      
      However, the check on PF_VCPU is wrong on s390, where preemption has
      to stay enabled in order to correctly process page faults.  Thus,
      s390 reenables preemption and starts to execute the guest.  The thread
      might be scheduled out between kvm_enter_guest() and kvm_exit_guest(),
      resulting in PF_VCPU being set but not being run.  When this happens,
      the opportunity for directed yield is missed.
      
      However, this check is done already in kvm_vcpu_on_spin before calling
      kvm_vcpu_yield_loop:
      
              if (!ACCESS_ONCE(vcpu->preempted))
                      continue;
      
      so the check on PF_VCPU is superfluous in general, and this patch
      removes it.
      Signed-off-by: NDavid Hildenbrand <dahi@linux.vnet.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      eed6e79d