08 Jun, 2010

1 commit

  • * xen_create_contiguous_region needs access to the balloon lock to
    ensure memory doesn't change under its feet, so expose the balloon
    lock
    * Change the name of the lock to xen_reservation_lock, to imply it's
    now less-specific usage.

    [ Impact: cleanup ]

    Signed-off-by: Alex Nixon
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Konrad Rzeszutek Wilk

    Alex Nixon
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

12 Dec, 2009

1 commit

  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (109 commits)
    PCI: fix coding style issue in pci_save_state()
    PCI: add pci_request_acs
    PCI: fix BUG_ON triggered by logical PCIe root port removal
    PCI: remove ifdefed pci_cleanup_aer_correct_error_status
    PCI: unconditionally clear AER uncorr status register during cleanup
    x86/PCI: claim SR-IOV BARs in pcibios_allocate_resource
    PCI: portdrv: remove redundant definitions
    PCI: portdrv: remove unnecessary struct pcie_port_data
    PCI: portdrv: minor cleanup for pcie_port_device_register
    PCI: portdrv: add missing irq cleanup
    PCI: portdrv: enable device before irq initialization
    PCI: portdrv: cleanup service irqs initialization
    PCI: portdrv: check capabilities first
    PCI: portdrv: move PME capability check
    PCI: portdrv: remove redundant pcie type calculation
    PCI: portdrv: cleanup pcie_device registration
    PCI: portdrv: remove redundant pcie_port_device_probe
    PCI: Always set prefetchable base/limit upper32 registers
    PCI: read-modify-write the pcie device control register when initiating pcie flr
    PCI: show dma_mask bits in /sys
    ...

    Fixed up conflicts in:
    arch/x86/kernel/amd_iommu_init.c
    drivers/pci/dmar.c
    drivers/pci/hotplug/acpiphp_glue.c

    Linus Torvalds
     

05 Dec, 2009

2 commits

  • Currently if the balloon driver is unable to increase the guest's
    reservation it assumes the failure was due to reaching its full
    allocation, gives up on the ballooning operation and records the limit
    it reached as the "hard limit". The driver will not try again until
    the target is set again (even to the same value).

    However it is possible that ballooning has in fact failed due to
    memory pressure in the host and therefore it is desirable to keep
    attempting to reach the target in case memory becomes available. The
    most likely scenario is that some guests are ballooning down while
    others are ballooning up and therefore there is temporary memory
    pressure while things stabilise. You would not expect a well behaved
    toolstack to ask a domain to balloon to more than its allocation nor
    would you expect it to deliberately over-commit memory by setting
    balloon targets which exceed the total host memory.

    This patch drops the concept of a hard limit and causes the balloon
    driver to retry increasing the reservation on a timer in the same
    manner as when decreasing the reservation.

    Also if we partially succeed in increasing the reservation
    (i.e. receive less pages than we asked for) then we may as well keep
    those pages rather than returning them to Xen.

    Signed-off-by: Ian Campbell
    Cc: Stable Kernel

    Ian Campbell
     
  • Change totalram_pages when a single page is added/removed to the
    ballooned list. This avoid totalram_pages to be set erroneously to
    max_pfn at boot.

    Signed-off-by: Gianluca Guida
    Signed-off-by: Jeremy Fitzhardinge
    Cc: Stable Kernel

    Gianluca Guida
     

05 Nov, 2009

1 commit


22 Sep, 2009

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits)
    trivial: fix typo in aic7xxx comment
    trivial: fix comment typo in drivers/ata/pata_hpt37x.c
    trivial: typo in kernel-parameters.txt
    trivial: fix typo in tracing documentation
    trivial: add __init/__exit macros in drivers/gpio/bt8xxgpio.c
    trivial: add __init macro/ fix of __exit macro location in ipmi_poweroff.c
    trivial: remove unnecessary semicolons
    trivial: Fix duplicated word "options" in comment
    trivial: kbuild: remove extraneous blank line after declaration of usage()
    trivial: improve help text for mm debug config options
    trivial: doc: hpfall: accept disk device to unload as argument
    trivial: doc: hpfall: reduce risk that hpfall can do harm
    trivial: SubmittingPatches: Fix reference to renumbered step
    trivial: fix typos "man[ae]g?ment" -> "management"
    trivial: media/video/cx88: add __init/__exit macros to cx88 drivers
    trivial: fix typo in CONFIG_DEBUG_FS in gcov doc
    trivial: fix missing printk space in amd_k7_smp_check
    trivial: fix typo s/ketymap/keymap/ in comment
    trivial: fix typo "to to" in multiple files
    trivial: fix typos in comments s/DGBU/DBGU/
    ...

    Linus Torvalds
     
  • Sizing of memory allocations shouldn't depend on the number of physical
    pages found in a system, as that generally includes (perhaps a huge amount
    of) non-RAM pages. The amount of what actually is usable as storage
    should instead be used as a basis here.

    Some of the calculations (i.e. those not intending to use high memory)
    should likely even use (totalram_pages - totalhigh_pages).

    Signed-off-by: Jan Beulich
    Acked-by: Rusty Russell
    Acked-by: Ingo Molnar
    Cc: Dave Airlie
    Cc: Kyle McMartin
    Cc: Jeremy Fitzhardinge
    Cc: Pekka Enberg
    Cc: Hugh Dickins
    Cc: "David S. Miller"
    Cc: Patrick McHardy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     

21 Sep, 2009

1 commit


06 May, 2009

1 commit


29 Jan, 2009

1 commit

  • 1: make "target_kb" only accept and produce a memory size in kilobytes.
    2: add a second "target" file which produces output in bytes, and will accept
    memparse input (scaled bytes)

    This fixes the rather irritating problem that writing the same value
    read back into target_kb would end up shrinking the domain by a factor
    of 1024, with generally bad results.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Stable Kernel
    Cc: "dan.magenheimer@oracle.com"
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     

24 Jan, 2009

1 commit


23 Jan, 2009

1 commit

  • Fix this:

    > It appears that in the upstream balloon driver,
    > the call to HYPERVISOR_update_va_mapping is missing
    > from decrease_reservation. I think as a result,
    > the balloon driver is eating memory but not
    > releasing it to Xen, thus rendering the balloon
    > driver essentially useless. (Can be observed via xentop.)

    Signed-off-by: Dan Magenheimer
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Dan Magenheimer
     

17 Dec, 2008

1 commit


18 Nov, 2008

1 commit

  • Impact: fix guest kernel crash with CONFIG_XEN_SCRUB_PAGES=y

    Jens noticed that scrub_page() has a buggy unmap of the wrong
    thing. (virtual address instead of page)

    Linus pointed out that the whole scrub_page() code is an unnecessary
    reimplementation of clear_highpage() to begin with.

    Just use clear_highpage() rather than reimplementing it poorly.

    Reported-by: Jens Axboe
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     

05 Nov, 2008

1 commit


03 Oct, 2008

1 commit


20 Aug, 2008

1 commit

  • There are four operating modes Xen code may find itself running in:
    - native
    - hvm domain
    - pv dom0
    - pv domU

    Clean up predicates for testing for these states to make them more consistent.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Xen-devel
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     

28 Jul, 2008

2 commits

  • Remove some unused functions:

    balloon_update_driver_allowance
    balloon_release_driver_page
    only used on the (obsolete, removed) flip path in netfront
    alloc_empty_pages_and_pagevec
    free_empty_pages_and_pagevec
    only used in backend drivers; can be reintroduced when needed

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     
  • 1. Set the class so it doesn't clash with the normal memory class
    2. Fix up the sysfs show functions to match the new prototype
    3. Clean up use of memparse

    Signed-off-by: Jeremy Fitzhardinge
    Cc: "viets@work.de"
    Cc: Andi Kleen
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     

22 Jul, 2008

1 commit

  • This allow to dynamically generate attributes and share show/store
    functions between attributes. Right now most attributes are generated
    by special macros and lots of duplicated code. With the attribute
    passed it's instead possible to attach some data to the attribute
    and then use that in shared low level functions to do different things.

    I need this for the dynamically generated bank attributes in the x86
    machine check code, but it'll allow some further cleanups.

    I converted all users in tree to the new show/store prototype. It's a single
    huge patch to avoid unbisectable sections.

    Runtime tested: x86-32, x86-64
    Compiled only: ia64, powerpc
    Not compile tested/only grep converted: sh, arm, avr32

    Signed-off-by: Andi Kleen
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     

27 May, 2008

2 commits

  • Make the needlessly global balloon_set_new_target() static.

    Signed-off-by: Adrian Bunk
    Acked-by: Chris Wright
    Signed-off-by: Andrew Morton
    Signed-off-by: Thomas Gleixner

    Adrian Bunk
     
  • fix compilation error of ballon driver on ia64.
    extent_start member is pointer argument. On x86 pointer argument for
    xen hypercall is passed as virtual address.
    On the other hand, ia64 and ppc, pointer argument is passed in pseudo
    physical address. (guest physicall address.)
    So they must be passed as handle and convert right before issuing hypercall.

    CC drivers/xen/balloon.o
    linux-2.6-x86/drivers/xen/balloon.c: In function 'increase_reservation':
    linux-2.6-x86/drivers/xen/balloon.c:228: error: incompatible types in assignment
    linux-2.6-x86/drivers/xen/balloon.c: In function 'decrease_reservation':
    linux-2.6-x86/drivers/xen/balloon.c:324: error: incompatible types in assignment
    linux-2.6-x86/drivers/xen/balloon.c: In function 'dealloc_pte_fn':
    linux-2.6-x86/drivers/xen/balloon.c:486: error: incompatible types in assignment
    linux-2.6-x86/drivers/xen/balloon.c: In function 'alloc_empty_pages_and_pagevec':
    linux-2.6-x86/drivers/xen/balloon.c:522: error: incompatible types in assignment
    make[2]: *** [drivers/xen/balloon.o] Error 1

    Signed-off-by: Isaku Yamahata
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Thomas Gleixner

    Isaku Yamahata
     

25 Apr, 2008

1 commit

  • The balloon driver allows memory to be dynamically added or removed from the domain,
    in order to allow host memory to be balanced between multiple domains.

    This patch introduces the Xen balloon driver, though it currently only
    allows a domain to be shrunk from its initial size (and re-grown back to
    that size). A later patch will add the ability to grow a domain beyond
    its initial size.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Jeremy Fitzhardinge