Skip to content
  1. Jan 03, 2009
  2. Jan 02, 2009
  3. Dec 31, 2008
    • Al Viro's avatar
      take init_fs to saner place · 18d8fda7
      Al Viro authored
      
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      18d8fda7
    • Nicholas Piggin's avatar
      shrink struct dentry · c2452f32
      Nicholas Piggin authored
      
      
      struct dentry is one of the most critical structures in the kernel. So it's
      sad to see it going neglected.
      
      With CONFIG_PROFILING turned on (which is probably the common case at least
      for distros and kernel developers), sizeof(struct dcache) == 208 here
      (64-bit). This gives 19 objects per slab.
      
      I packed d_mounted into a hole, and took another 4 bytes off the inline
      name length to take the padding out from the end of the structure. This
      shinks it to 200 bytes. I could have gone the other way and increased the
      length to 40, but I'm aiming for a magic number, read on...
      
      I then got rid of the d_cookie pointer. This shrinks it to 192 bytes. Rant:
      why was this ever a good idea? The cookie system should increase its hash
      size or use a tree or something if lookups are a problem. Also the "fast
      dcookie lookups" in oprofile should be moved into the dcookie code -- how
      can oprofile possibly care about the dcookie_mutex? It gets dropped after
      get_dcookie() returns so it can't be providing any sort of protection.
      
      At 192 bytes, 21 objects fit into a 4K page, saving about 3MB on my system
      with ~140 000 entries allocated. 192 is also a multiple of 64, so we get
      nice cacheline alignment on 64 and 32 byte line systems -- any given dentry
      will now require 3 cachelines to touch all fields wheras previously it
      would require 4.
      
      I know the inline name size was chosen quite carefully, however with the
      reduction in cacheline footprint, it should actually be just about as fast
      to do a name lookup for a 36 character name as it was before the patch (and
      faster for other sizes). The memory footprint savings for names which are
      <= 32 or > 36 bytes long should more than make up for the memory cost for
      33-36 byte names.
      
      Performance is a feature...
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      c2452f32
    • Marcelo Tosatti's avatar
      KVM: MMU: handle large host sptes on invlpg/resync · 87917239
      Marcelo Tosatti authored
      
      
      The invlpg and sync walkers lack knowledge of large host sptes,
      descending to non-existant pagetable level.
      
      Stop at directory level in such case.
      
      Fixes SMP Windows XP with hugepages.
      
      Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      87917239
    • Avi Kivity's avatar
      KVM: Add locking to virtual i8259 interrupt controller · 3f353858
      Avi Kivity authored
      
      
      While most accesses to the i8259 are with the kvm mutex taken, the call
      to kvm_pic_read_irq() is not.  We can't easily take the kvm mutex there
      since the function is called with interrupts disabled.
      
      Fix by adding a spinlock to the virtual interrupt controller.  Since we
      can't send an IPI under the spinlock (we also take the same spinlock in
      an irq disabled context), we defer the IPI until the spinlock is released.
      Similarly, we defer irq ack notifications until after spinlock release to
      avoid lock recursion.
      
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      3f353858
    • Avi Kivity's avatar
      KVM: MMU: Don't treat a global pte as such if cr4.pge is cleared · 25e23432
      Avi Kivity authored
      
      
      The pte.g bit is meaningless if global pages are disabled; deferring
      mmu page synchronization on these ptes will lead to the guest using stale
      shadow ptes.
      
      Fixes Vista x86 smp bootloader failure.
      
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      25e23432
    • Jes Sorensen's avatar
      KVM: ia64: Fix kvm_arch_vcpu_ioctl_[gs]et_regs() · 042b26ed
      Jes Sorensen authored
      
      
      Fix kvm_arch_vcpu_ioctl_[gs]et_regs() to do something meaningful on
      ia64. Old versions could never have worked since they required
      pointers to be set in the ioctl payload which were never being set by
      the ioctl handler for get_regs.
      
      In addition reserve extra space for future extensions.
      
      The change of layout of struct kvm_regs doesn't require adding a new
      CAP since get/set regs never worked on ia64 until now.
      
      This version doesn't support copying the KVM kernel stack in/out of
      the kernel. This should be implemented in a seperate ioctl call if
      ever needed.
      
      Signed-off-by: default avatarJes Sorensen <jes@sgi.com>
      Acked-by : Xiantao Zhang <xiantao.zhang@intel.com>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      042b26ed
    • Jan Kiszka's avatar
      KVM: x86: Rework user space NMI injection as KVM_CAP_USER_NMI · 4531220b
      Jan Kiszka authored
      
      
      There is no point in doing the ready_for_nmi_injection/
      request_nmi_window dance with user space. First, we don't do this for
      in-kernel irqchip anyway, while the code path is the same as for user
      space irqchip mode. And second, there is nothing to loose if a pending
      NMI is overwritten by another one (in contrast to IRQs where we have to
      save the number). Actually, there is even the risk of raising spurious
      NMIs this way because the reason for the held-back NMI might already be
      handled while processing the first one.
      
      Therefore this patch creates a simplified user space NMI injection
      interface, exporting it under KVM_CAP_USER_NMI and dropping the old
      KVM_CAP_NMI capability. And this time we also take care to provide the
      interface only on archs supporting NMIs via KVM (right now only x86).
      
      Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      4531220b
Loading