aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xen-selfballoon.c
diff options
context:
space:
mode:
authorDan Magenheimer <dan.magenheimer@oracle.com>2013-04-30 18:27:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 20:04:01 -0400
commit10a7a0771399a57a297fca9615450dbb3f88081a (patch)
tree7c8564daf7ce2698277a4a38edb9ef0f636cb429 /drivers/xen/xen-selfballoon.c
parentff610a1d55da22bf95bbc6a8b193e052169b34b7 (diff)
xen: tmem: enable Xen tmem shim to be built/loaded as a module
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: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Bob 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/xen/xen-selfballoon.c')
-rw-r--r--drivers/xen/xen-selfballoon.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/xen/xen-selfballoon.c b/drivers/xen/xen-selfballoon.c
index 2552d3e0a70f..f2ef569c7cc1 100644
--- a/drivers/xen/xen-selfballoon.c
+++ b/drivers/xen/xen-selfballoon.c
@@ -121,7 +121,7 @@ static DECLARE_DELAYED_WORK(selfballoon_worker, selfballoon_process);
121static bool frontswap_selfshrinking __read_mostly; 121static bool frontswap_selfshrinking __read_mostly;
122 122
123/* Enable/disable with kernel boot option. */ 123/* Enable/disable with kernel boot option. */
124static bool use_frontswap_selfshrink __initdata = true; 124static bool use_frontswap_selfshrink = true;
125 125
126/* 126/*
127 * The default values for the following parameters were deemed reasonable 127 * The default values for the following parameters were deemed reasonable
@@ -185,7 +185,7 @@ static int __init xen_nofrontswap_selfshrink_setup(char *s)
185__setup("noselfshrink", xen_nofrontswap_selfshrink_setup); 185__setup("noselfshrink", xen_nofrontswap_selfshrink_setup);
186 186
187/* Disable with kernel boot option. */ 187/* Disable with kernel boot option. */
188static bool use_selfballooning __initdata = true; 188static bool use_selfballooning = true;
189 189
190static int __init xen_noselfballooning_setup(char *s) 190static int __init xen_noselfballooning_setup(char *s)
191{ 191{
@@ -196,7 +196,7 @@ static int __init xen_noselfballooning_setup(char *s)
196__setup("noselfballooning", xen_noselfballooning_setup); 196__setup("noselfballooning", xen_noselfballooning_setup);
197#else /* !CONFIG_FRONTSWAP */ 197#else /* !CONFIG_FRONTSWAP */
198/* Enable with kernel boot option. */ 198/* Enable with kernel boot option. */
199static bool use_selfballooning __initdata = false; 199static bool use_selfballooning;
200 200
201static int __init xen_selfballooning_setup(char *s) 201static int __init xen_selfballooning_setup(char *s)
202{ 202{
@@ -537,7 +537,7 @@ int register_xen_selfballooning(struct device *dev)
537} 537}
538EXPORT_SYMBOL(register_xen_selfballooning); 538EXPORT_SYMBOL(register_xen_selfballooning);
539 539
540static int __init xen_selfballoon_init(void) 540int xen_selfballoon_init(bool use_selfballooning, bool use_frontswap_selfshrink)
541{ 541{
542 bool enable = false; 542 bool enable = false;
543 543
@@ -571,7 +571,4 @@ static int __init xen_selfballoon_init(void)
571 571
572 return 0; 572 return 0;
573} 573}
574 574EXPORT_SYMBOL(xen_selfballoon_init);
575subsys_initcall(xen_selfballoon_init);
576
577MODULE_LICENSE("GPL");