linux/drivers/xen
Bob Liu d4c7abdff7 drivers:xen-selfballoon:reset 'frontswap_inertia_counter' after frontswap_shrink
When I looked at this issue https://lkml.org/lkml/2013/11/21/158, I found that
frontswap_selfshrink() doesn't work as expected sometimes.
Pages are continuously added to frontswap and gotten back soon. It's a waste of
cpu time and increases the memory pressue of Guest OS.

Take an example.
First time in frontswap_selfshrink():
1. last_frontswap_pages = cur_frontswap_pages = 0
2. cur_frontswap_pages  = frontswap_curr_pages() = 100

When 'frontswap_inertia_counter' decreased to 0:
1. last_frontswap_pages = cur_frontswap_pages = 100
2. cur_frontswap_pages = frontswap_curr_pages() = 100
3. call frontswap_shrink() and let's assumption that 10 pages are gotten back
   from frontswap.
4. now frontswap_curr_pages() is 90.

If then memory is not enough in Guest OS and 9 more pages(smaller than gotten
back) added to frontswap.
Now frontswap_curr_pages() is 99 and we don't expect to get back more pages from
frontswap because geust os is under memory pressure.

But next time in frontswap_selfshrink():
1. last_frontswap_pages is set to the old value of cur_frontswap_pages(still
   100)
2. cur_frontswap_pages(99) is still smaller than last_frontswap_pages.
3. call frontswap_shrink() and continue to get back pages from frontswap!!

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2014-02-28 15:26:12 -05:00
..
events xen/events: bind all new interdomain events to VCPU0 2014-02-11 10:12:34 -05:00
xen-pciback xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
xenbus xen/pvh: Piggyback on PVHVM XenBus. 2014-01-06 10:44:23 -05:00
xenfs xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
acpi.c xen / ACPI: notify xen when reduced hardware sleep is available 2013-07-31 14:22:35 +02:00
balloon.c xen: simplify balloon_first_page() with list_first_entry_or_null() 2014-01-06 10:07:29 -05:00
biomerge.c xen: using EXPORT_SYMBOL requires including export.h 2012-01-18 15:37:49 -08:00
cpu_hotplug.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
dbgp.c xen: Use dev_is_pci() to check whether it is pci device 2014-01-07 09:53:33 -05:00
evtchn.c xen/evtchn: support more than 4096 ports 2014-01-06 10:07:50 -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
gntalloc.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
gntdev.c Revert "xen/grant-table: Avoid m2p_override during mapping" 2014-02-03 06:44:49 -05:00
grant-table.c Revert "xen/grant-table: Avoid m2p_override during mapping" 2014-02-03 06:44:49 -05:00
Kconfig Features: 2014-01-22 22:00:18 -08:00
Makefile ia64/xen: Remove Xen support for ia64 even more 2014-02-11 10:12:37 -05:00
manage.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-07-06 14:09:38 -07:00
mcelog.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
pci.c xen/pci: Fix build on non-x86 2014-01-06 10:07:30 -05:00
pcpu.c drivers: xen: Include appropriate header file in pcpu.c 2014-02-28 15:26:08 -05:00
platform-pci.c drivers: xen: Mark function as static in platform-pci.c 2014-02-28 15:26:04 -05:00
privcmd.c xen: privcmd: do not return pages which we have failed to unmap 2013-12-06 17:55:56 +00:00
privcmd.h xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
swiotlb-xen.c xen: swiotlb: handle sizeof(dma_addr_t) != sizeof(phys_addr_t) 2014-01-30 12:54:20 +00:00
sys-hypervisor.c xen: sysfs: fix build warning. 2012-10-19 15:17:51 -04:00
tmem.c Bug-fixes: 2013-07-03 13:12:42 -07:00
xen-acpi-cpuhotplug.c Merge branch 'acpi-cleanup' into acpi-hotplug 2013-12-07 01:05:17 +01:00
xen-acpi-memhotplug.c Merge branch 'acpi-cleanup' into acpi-hotplug 2013-12-07 01:05:17 +01:00
xen-acpi-pad.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
xen-acpi-processor.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
xen-balloon.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
xen-selfballoon.c drivers:xen-selfballoon:reset 'frontswap_inertia_counter' after frontswap_shrink 2014-02-28 15:26:12 -05:00
xen-stub.c xen/acpi: remove redundant acpi/acpi_drivers.h include 2013-03-11 13:53:02 -04:00