linux-sg2042/drivers/xen
Konrad Rzeszutek Wilk b2c75c446a xen/tmem: Don't over-write tmem_frontswap_poolid after tmem_frontswap_init set it.
Commit 10a7a07713 ("xen: tmem: enable Xen
tmem shim to be built/loaded as a module") allows the tmem module
to be loaded any time. For this work the frontswap API had to
be able to asynchronously to call tmem_frontswap_init before
or after the swap image had been set. That was added in git
commit 905cd0e1bf
("mm: frontswap: lazy initialization to allow tmem backends to build/run as modules").

Which means we could do this (The common case):

 modprobe tmem		[so calls frontswap_register_ops, no ->init]
			 modifies tmem_frontswap_poolid = -1
 swapon /dev/xvda1	[__frontswap_init, calls -> init, tmem_frontswap_poolid is
			 < 0 so tmem hypercall done]

Or the failing one:

 swapon /dev/xvda1	[calls __frontswap_init, sets the need_init bitmap]
 modprobe tmem		[calls frontswap_register_ops, -->init calls, finds out
			tmem_frontswap_poolid is 0, does not make a hypercall.
			Later in the module_init, sets tmem_frontswap_poolid=-1]

Which meant that in the failing case we would not call the hypercall
to initialize the pool and never be able to make any frontswap
backend calls.

Moving the frontswap_register_ops after setting the tmem_frontswap_poolid
fixes it.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
2013-06-10 10:14:33 -04:00
..
xen-pciback xen-pciback: more uses of cached MSI-X capability offset 2013-05-29 09:04:22 -04:00
xenbus xenbus_client.c: correct exit path for xenbus_map_ring_valloc_hvm 2013-05-29 15:24:55 -04:00
xenfs fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
Kconfig xen/tmem: Remove the usage of '[no|]selfballoon' and use 'tmem.selfballooning' bool instead. 2013-05-15 10:27:49 -04:00
Makefile xen/acpi: ACPI cpu hotplug 2013-02-19 22:02:29 -05:00
acpi.c xen/acpi/sleep: Enable ACPI sleep via the __acpi_os_prepare_sleep 2012-05-07 15:33:18 -04:00
balloon.c xen: Fixed assignment error in if statement 2013-05-20 14:14:48 -04:00
biomerge.c xen: using EXPORT_SYMBOL requires including export.h 2012-01-18 15:37:49 -08:00
cpu_hotplug.c Xen: properly bound buffer access when parsing cpu/*/availability 2013-01-15 15:57:02 -05:00
dbgp.c xen: dbgp: Fix warning when CONFIG_PCI is not enabled. 2012-10-19 15:19:37 -04:00
events.c Bug-fixes: 2013-05-11 16:19:30 -07:00
evtchn.c xen: close evtchn port if binding to irq fails 2013-02-19 22:02:33 -05:00
fallback.c xen-pciback: notify hypervisor about devices intended to be assigned to guests 2013-03-22 10:20:55 -04:00
features.c xen: clean up asm/xen/hypervisor.h 2008-12-16 21:50:31 +01:00
gntalloc.c mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
gntdev.c xen/gntdev: remove erronous use of copy_to_user 2013-01-15 16:02:40 -05:00
grant-table.c xen: introduce xen_remap, use it instead of ioremap 2013-02-19 22:02:34 -05:00
manage.c xen/resume: Fix compile warnings. 2012-04-19 15:12:49 -04:00
mcelog.c xen/mce: add .poll method for mcelog device driver 2012-07-19 15:51:41 -04:00
pci.c xen/pci: Check for PCI bridge before using it. 2012-05-30 10:16:35 -04:00
pcpu.c Features: 2013-02-24 16:18:31 -08:00
platform-pci.c Drivers: xen: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
privcmd.c xen/privcmd: fix condition in privcmd_close() 2013-05-15 10:23:40 -04:00
privcmd.h xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
swiotlb-xen.c x86: Don't panic if can not alloc buffer for swiotlb 2013-01-29 19:36:53 -08:00
sys-hypervisor.c xen: sysfs: fix build warning. 2012-10-19 15:17:51 -04:00
tmem.c xen/tmem: Don't over-write tmem_frontswap_poolid after tmem_frontswap_init set it. 2013-06-10 10:14:33 -04:00
xen-acpi-cpuhotplug.c xen/acpi: xen cpu hotplug minor updates 2013-02-25 07:44:29 -05:00
xen-acpi-memhotplug.c xen/acpi: xen memory hotplug minor updates 2013-02-25 07:44:21 -05:00
xen-acpi-pad.c ACPI: Remove useless type argument of driver .remove() operation 2013-01-26 00:37:24 +01:00
xen-acpi-processor.c xen: resolve section mismatch warnings in xen-acpi-processor 2013-04-19 10:44:23 -04:00
xen-balloon.c Features: 2012-03-22 20:16:14 -07:00
xen-selfballoon.c xen/tmem: Don't use self[ballooning|shrinking] if frontswap is off. 2013-05-15 10:27:50 -04:00
xen-stub.c xen/acpi: remove redundant acpi/acpi_drivers.h include 2013-03-11 13:53:02 -04:00
xencomm.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00