1. 23 10月, 2015 2 次提交
  2. 09 9月, 2015 1 次提交
  3. 08 9月, 2015 1 次提交
  4. 20 7月, 2015 1 次提交
    • J
      xen: release lock occasionally during ballooning · 929423fa
      Juergen Gross 提交于
      When dom0 is being ballooned balloon_process() will hold the balloon
      mutex until it is finished. This will block e.g. creation of new
      domains as the device backends for the new domain need some
      autoballooned pages for the ring buffers.
      
      Avoid this by releasing the balloon mutex from time to time during
      ballooning. Adjust the comment above balloon_process() regarding
      multiple instances of balloon_process().
      
      Instead of open coding it, just use cond_resched().
      Signed-off-by: NJuergen Gross <jgross@suse.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      929423fa
  5. 23 3月, 2015 1 次提交
  6. 28 1月, 2015 1 次提交
    • D
      xen: remove scratch frames for ballooned pages and m2p override · 0bb599fd
      David Vrabel 提交于
      The scratch frame mappings for ballooned pages and the m2p override
      are broken.  Remove them in preparation for replacing them with
      simpler mechanisms that works.
      
      The scratch pages did not ensure that the page was not in use.  In
      particular, the foreign page could still be in use by hardware.  If
      the guest reused the frame the hardware could read or write that
      frame.
      
      The m2p override did not handle the same frame being granted by two
      different grant references.  Trying an M2P override lookup in this
      case is impossible.
      
      With the m2p override removed, the grant map/unmap for the kernel
      mappings (for x86 PV) can be easily batched in
      set_foreign_p2m_mapping() and clear_foreign_p2m_mapping().
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      0bb599fd
  7. 23 10月, 2014 1 次提交
  8. 02 9月, 2014 1 次提交
  9. 04 7月, 2014 1 次提交
  10. 25 3月, 2014 1 次提交
    • W
      xen/balloon: flush persistent kmaps in correct position · 09ed3d5b
      Wei Liu 提交于
      Xen balloon driver will update ballooned out pages' P2M entries to point
      to scratch page for PV guests. In 24f69373 ("xen/balloon: don't alloc
      page while non-preemptible", kmap_flush_unused was moved after updating
      P2M table. In that case for 32 bit PV guest we might end up with
      
        P2M    X -----> S  (S is mfn of balloon scratch page)
        M2P    Y -----> X  (Y is mfn in persistent kmap entry)
      
      kmap_flush_unused() iterates through all the PTEs in the kmap address
      space, using pte_to_page() to obtain the page. If the p2m and the m2p
      are inconsistent the incorrect page is returned.  This will clear
      page->address on the wrong page which may cause subsequent oopses if
      that page is currently kmap'ed.
      
      Move the flush back between get_page and __set_phys_to_machine to fix
      this.
      Signed-off-by: NWei Liu <wei.liu2@citrix.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Cc: stable@vger.kernel.org # 3.12+
      09ed3d5b
  11. 20 3月, 2014 1 次提交
    • S
      xen, balloon: Fix CPU hotplug callback registration · 43ea9536
      Srivatsa S. Bhat 提交于
      Subsystems that want to register CPU hotplug callbacks, as well as perform
      initialization for the CPUs that are already online, often do it as shown
      below:
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	put_online_cpus();
      
      This is wrong, since it is prone to ABBA deadlocks involving the
      cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
      with CPU hotplug operations).
      
      The xen balloon driver doesn't take get/put_online_cpus() around this code,
      but that is also buggy, since it can miss CPU hotplug events in between the
      initialization and callback registration:
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      		   ^
      		   |  Race window; Can miss CPU hotplug events here.
      		   v
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      Interestingly, the balloon code in xen can simply be reorganized as shown
      below, to have a race-free method to register hotplug callbacks, without even
      taking get/put_online_cpus(). This is because the initialization performed for
      already online CPUs is exactly the same as that performed for CPUs that come
      online later. Moreover, the code has checks in place to avoid double
      initialization.
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	put_online_cpus();
      
      A hotplug operation that occurs between registering the notifier and calling
      get_online_cpus(), won't disrupt anything, because the code takes care to
      perform the memory allocations only once.
      
      So reorganize the balloon code in xen this way to fix the issues with CPU
      hotplug callback registration.
      
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      43ea9536
  12. 06 1月, 2014 1 次提交
  13. 14 12月, 2013 1 次提交
  14. 09 11月, 2013 2 次提交
  15. 25 9月, 2013 1 次提交
  16. 12 9月, 2013 2 次提交
  17. 31 8月, 2013 1 次提交
  18. 09 8月, 2013 1 次提交
  19. 04 7月, 2013 1 次提交
    • J
      mm: correctly update zone->managed_pages · 3dcc0571
      Jiang Liu 提交于
      Enhance adjust_managed_page_count() to adjust totalhigh_pages for
      highmem pages.  And change code which directly adjusts totalram_pages to
      use adjust_managed_page_count() because it adjusts totalram_pages,
      totalhigh_pages and zone->managed_pages altogether in a safe way.
      
      Remove inc_totalhigh_pages() and dec_totalhigh_pages() from xen/balloon
      driver bacause adjust_managed_page_count() has already adjusted
      totalhigh_pages.
      
      This patch also fixes two bugs:
      
      1) enhances virtio_balloon driver to adjust totalhigh_pages when
         reserve/unreserve pages.
      2) enhance memory_hotplug.c to adjust totalhigh_pages when hot-removing
         memory.
      
      We still need to deal with modifications of totalram_pages in file
      arch/powerpc/platforms/pseries/cmm.c, but need help from PPC experts.
      
      [akpm@linux-foundation.org: remove ifdef, per Wanpeng Li, virtio_balloon.c cleanup, per Sergei]
      [akpm@linux-foundation.org: export adjust_managed_page_count() to modules, for drivers/virtio/virtio_balloon.c]
      Signed-off-by: NJiang Liu <jiang.liu@huawei.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Wen Congyang <wency@cn.fujitsu.com>
      Cc: Tang Chen <tangchen@cn.fujitsu.com>
      Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: <sworddragon2@aol.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jianguo Wu <wujianguo@huawei.com>
      Cc: Joonsoo Kim <js1304@gmail.com>
      Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3dcc0571
  20. 28 6月, 2013 1 次提交
    • J
      xen: Convert printks to pr_<level> · 283c0972
      Joe Perches 提交于
      Convert printks to pr_<level> (excludes printk(KERN_DEBUG...)
      to be more consistent throughout the xen subsystem.
      
      Add pr_fmt with KBUILD_MODNAME or "xen:" KBUILD_MODNAME
      Coalesce formats and add missing word spaces
      Add missing newlines
      Align arguments and reflow to 80 columns
      Remove DRV_NAME from formats as pr_fmt adds the same content
      
      This does change some of the prefixes of these messages
      but it also does make them more consistent.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      283c0972
  21. 21 5月, 2013 1 次提交
  22. 29 11月, 2012 1 次提交
  23. 20 10月, 2012 2 次提交
  24. 17 11月, 2011 1 次提交
  25. 01 11月, 2011 1 次提交
  26. 29 9月, 2011 4 次提交
  27. 27 7月, 2011 1 次提交
  28. 26 7月, 2011 1 次提交
    • D
      xen/balloon: memory hotplug support for Xen balloon driver · 080e2be7
      Daniel Kiper 提交于
      Memory hotplug support for Xen balloon driver.  It should be mentioned
      that hotplugged memory is not onlined automatically.  It should be onlined
      by user through standard sysfs interface.
      
      Memory could be hotplugged in following steps:
      
        1) dom0: xl mem-max <domU> <maxmem>
           where <maxmem> is >= requested memory size,
      
        2) dom0: xl mem-set <domU> <memory>
           where <memory> is requested memory size; alternatively memory
           could be added by writing proper value to
           /sys/devices/system/xen_memory/xen_memory0/target or
           /sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,
      
        3) domU: for i in /sys/devices/system/memory/memory*/state; do \
                   [ "`cat "$i"`" = offline ] && echo online > "$i"; done
      
      Memory could be onlined automatically on domU by adding following line to
      udev rules:
      
        SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"
      
      In that case step 3 should be omitted.
      Signed-off-by: NDaniel Kiper <dkiper@net-space.pl>
      Acked-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      080e2be7
  29. 30 3月, 2011 4 次提交
  30. 16 3月, 2011 1 次提交