1. 01 5月, 2013 1 次提交
    • D
      xen: tmem: enable Xen tmem shim to be built/loaded as a module · 10a7a077
      Dan Magenheimer 提交于
      Allow Xen tmem shim to be built/loaded as a module.  Xen self-ballooning
      and frontswap-selfshrinking are now also "lazily" initialized when the
      Xen tmem shim is loaded as a module, unless explicitly disabled by
      module parameters.
      
      Note runtime dependency disallows loading if cleancache/frontswap lazy
      initialization patches are not present.
      
      If built-in (not built as a module), the original mechanism of enabling
      via a kernel boot parameter is retained, but this should be considered
      deprecated.
      
      Note that module unload is explicitly not yet supported.
      
      [v1: Removed the [CLEANCACHE|FRONTSWAP]_HAS_LAZY_INIT ifdef]
      [v2: Squashed the xen/tmem: Remove the subsys call patch in]
      [akpm@linux-foundation.org: fix build (disable_frontswap_selfshrinking undeclared)]
      Signed-off-by: NDan Magenheimer <dan.magenheimer@oracle.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NBob Liu <lliubbo@gmail.com>
      Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
      Cc: Andor Daam <andor.daam@googlemail.com>
      Cc: Florian Schmaus <fschmaus@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Stefan Hengelein <ilendir@googlemail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      10a7a077
  2. 16 11月, 2012 1 次提交
  3. 21 5月, 2012 1 次提交
  4. 15 3月, 2012 1 次提交
  5. 16 12月, 2011 1 次提交
  6. 15 12月, 2011 1 次提交
  7. 15 10月, 2011 1 次提交
    • D
      xen: Fix selfballooning and ensure it doesn't go too far · 38a1ed4f
      Dan Magenheimer 提交于
      The balloon driver's "current_pages" is very different from
      totalram_pages.  Self-ballooning needs to be driven by
      the latter.  Also, Committed_AS doesn't account for pages
      used by the kernel so:
      1) Add totalreserve_pages to Committed_AS for the normal target.
      2) Enforce a floor for when there are little or no user-space threads
         using memory (e.g. single-user mode) to avoid OOMs.  The floor
         function includes a "min_usable_mb" tuneable in case we discover
         later that the floor function is still too aggressive in some
         workloads, though likely it will not be needed.
      
      Changes since version 4:
      - change floor calculation so that it is not as aggressive; this version
        uses a piecewise linear function similar to minimum_target in the 2.6.18
        balloon driver, but modified to add to totalreserve_pages instead of
        subtract from max_pfn, the 2.6.18 version causes OOMs on recent kernels
        because the kernel has expanded over time
      - change safety_margin to min_usable_mb and comment on its use
      - since committed_as does NOT include kernel space (and other reserved
        pages), totalreserve_pages is now added to committed_as.  The result is
        less aggressive self-ballooning, but theoretically more appropriate.
      Changes since version 3:
      - missing include causes compile problem when CONFIG_FRONTSWAP is disabled
      - add comments after includes
      Changes since version 2:
      - missing include causes compile problem only on 32-bit
      Changes since version 1:
      - tuneable safety margin added
      
      [v5: avi.miller@oracle.com: still too aggressive, seeing some OOMs]
      [v4: konrad.wilk@oracle.com: fix compile when CONFIG_FRONTSWAP is disabled]
      [v3: guru.anbalagane@oracle.com: fix 32-bit compile]
      [v2: konrad.wilk@oracle.com: make safety margin tuneable]
      Signed-off-by: NDan Magenheimer <dan.magenheimer@oracle.com>
      [v1: Altered description and added an extra include]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      38a1ed4f
  8. 16 8月, 2011 1 次提交
    • R
      xen: self-balloon needs module.h · 4fec0e0b
      Randy Dunlap 提交于
      Fix build errors (found when CONFIG_SYSFS is not enabled):
      
        drivers/xen/xen-selfballoon.c:446: warning: data definition has no type or storage class
        drivers/xen/xen-selfballoon.c:446: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
        drivers/xen/xen-selfballoon.c:446: warning: parameter names (without types) in function declaration
        drivers/xen/xen-selfballoon.c:485: error: expected declaration specifiers or '...' before string constant
        drivers/xen/xen-selfballoon.c:485: warning: data definition has no type or storage class
        drivers/xen/xen-selfballoon.c:485: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
        drivers/xen/xen-selfballoon.c:485: warning: function declaration isn't a prototype
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Acked-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4fec0e0b
  9. 11 8月, 2011 1 次提交
    • R
      xen: xen-selfballoon.c needs more header files · 30eefc95
      Randy Dunlap 提交于
      Fix build errors (found when CONFIG_SYSFS is not enabled):
      
      drivers/xen/xen-selfballoon.c:446: warning: data definition has no type or storage class
      drivers/xen/xen-selfballoon.c:446: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
      drivers/xen/xen-selfballoon.c:446: warning: parameter names (without types) in function declaration
      drivers/xen/xen-selfballoon.c:485: error: expected declaration specifiers or '...' before string constant
      drivers/xen/xen-selfballoon.c:485: warning: data definition has no type or storage class
      drivers/xen/xen-selfballoon.c:485: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
      drivers/xen/xen-selfballoon.c:485: warning: function declaration isn't a prototype
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      30eefc95
  10. 04 8月, 2011 1 次提交
  11. 27 7月, 2011 1 次提交
  12. 09 7月, 2011 1 次提交
    • D
      xen: tmem: self-ballooning and frontswap-selfshrinking · a50777c7
      Dan Magenheimer 提交于
      This patch introduces two in-kernel drivers for Xen transcendent memory
      ("tmem") functionality that complement cleancache and frontswap.  Both
      use control theory to dynamically adjust and optimize memory utilization.
      Selfballooning controls the in-kernel Xen balloon driver, targeting a goal
      value (vm_committed_as), thus pushing less frequently used clean
      page cache pages (through the cleancache code) into Xen tmem where
      Xen can balance needs across all VMs residing on the physical machine.
      Frontswap-selfshrinking controls the number of pages in frontswap,
      driving it towards zero (effectively doing a partial swapoff) when
      in-kernel memory pressure subsides, freeing up RAM for other VMs.
      
      More detail is provided in the header comment of xen-selfballooning.c.
      Signed-off-by: NDan Magenheimer <dan.magenheimer@oracle.com>
      
      [v8: konrad.wilk@oracle.com: set default enablement depending on frontswap]
      [v7: konrad.wilk@oracle.com: fix capitalization and punctuation in comments]
      [v6: fix frontswap-selfshrinking initialization]
      [v6: konrad.wilk@oracle.com: fix init pr_infos; add comments about swap]
      [v5: konrad.wilk@oracle.com: add NULL to attr list; move inits up to decls]
      [v4: dkiper@net-space.pl: use strict_strtoul plus a few syntactic nits]
      [v3: konrad.wilk@oracle.com: fix potential divides-by-zero]
      [v3: konrad.wilk@oracle.com: add many more comments, fix nits]
      [v2: rebased to linux-3.0-rc1]
      [v2: Ian.Campbell@citrix.com: reorganize as new file (xen-selfballoon.c)]
      [v2: dkiper@net-space.pl: proper access to vm_committed_as]
      [v2: dkiper@net-space.pl: accounting fixes]
      Cc: Jan Beulich <JBeulich@novell.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: <xen-devel@lists.xensource.com>
      a50777c7