__GFP_WAIT was used to signal that the caller was in atomic context and
could not sleep. Now it is possible to distinguish between true atomic
context and callers that are not willing to sleep. The latter should
clear __GFP_DIRECT_RECLAIM so kswapd will still wake. As clearing
__GFP_WAIT behaves differently, there is a risk that people will clear the
wrong flags. This patch renames __GFP_WAIT to __GFP_RECLAIM to clearly
indicate what it does -- setting it allows all reclaim activity, clearing
them prevents it.
[[email protected]: fix build]
[[email protected]: coding-style fixes]
Signed-off-by: Mel Gorman <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: Christoph Lameter <[email protected]>
Acked-by: David Rientjes <[email protected]>
Cc: Vitaly Wool <[email protected]>
Cc: Rik van Riel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Get notified immediately when a balloon target is set, instead of waiting for
up to one second.
The up-to 1 second gap could be long enough to cause swapping inside of the
VM that receives the VM.
Acked-by: Andy King <[email protected]>
Signed-off-by: Xavier Deguillard <[email protected]>
Tested-by: Siva Sankar Reddy B <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Unify the behavior of the first start of the balloon and a reset. Also on
unload, declare that the balloon driver does not have any capabilities
anymore.
Acked-by: Andy King <[email protected]>
Signed-off-by: Xavier Deguillard <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2m ballooning significantly reduces the hypervisor side (and guest side)
overhead of ballooning and unballooning.
hypervisor only:
balloon unballoon
4 KB 2 GB/s 2.6 GB/s
2 MB 54 GB/s 767 GB/s
Use 2 MB pages as the hypervisor is alwys 64bit and 2 MB is the smallest
supported super-page size.
The code has to run on older versions of ESX and old balloon drivers run on
newer version of ESX. Hence match the capabilities with the host before 2m
page ballooning could be enabled.
Signed-off-by: Xavier Deguillard <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When VMware's hypervisor requests a VM to reclaim memory this is preferrably done
via ballooning. If the balloon driver does not return memory fast enough, more
drastic methods, such as hypervisor-level swapping are needed. These other methods
cause performance issues, e.g. hypervisor-level swapping requires the hypervisor to
swap in a page syncronously while the virtual CPU is blocked.
Hence it is in the interest of the VM to balloon memory as fast as possible. The
problem with doing this is that the VM might end up doing nothing else than
ballooning and the user might notice that the VM is stalled, esp. when the VM has
only a single virtual CPU.
This is less of a problem if the VM and the hypervisor perform balloon operations
faster. Also the balloon driver yields regularly, hence on a single virtual CPU
the Linux scheduler should be able to properly time-slice between ballooning and
other tasks.
Testing Done: quickly ballooned a lot of pages while wathing if there are any
perceived hickups (periods of non-responsiveness) in the execution of the
linux VM. No such hickups were seen.
Signed-off-by: Xavier Deguillard <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This helps with debugging vmw_balloon behavior, as it is clear what
functionality is enabled.
Acked-by: Andy King <[email protected]>
Signed-off-by: Xavier Deguillard <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Instead of waiting for the next GET_TARGET command, we can react faster
by exploiting the fact that each hypervisor call also returns the
balloon target.
Signed-off-by: Xavier Deguillard <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Philip P. Moltmann <[email protected]>
Acked-by: Andy King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Introduce a new capability to the driver that allow sending 512 pages in
one hypervisor call. This reduce the cost of the driver when reclaiming
memory.
Signed-off-by: Xavier Deguillard <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Philip P. Moltmann <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
In order to extend the balloon protocol, the hypervisor and the guest
driver need to agree on a set of supported functionality to use.
Signed-off-by: Xavier Deguillard <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Philip P. Moltmann <[email protected]>
Acked-by: Andy King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This split the function in two: the allocation part is inlined into the
inflate function and the lock part is kept into his own function.
This change is needed in order to be able to allocate more than one page
before doing the hypervisor call.
Signed-off-by: Xavier Deguillard <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Philip P. Moltmann <[email protected]>
Acked-by: Andy King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix for a -Wuninitialized compiler warning. Changed return value of
vmballoon_send_lock_page() from bool to int to be able to distinguish
between the error cases to avoid uninitialized use of hv_status in
vmballoon_reserve_page()
Signed-off-by: Danny Kukawka <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
In vmballoon_reserve_page(), flags has been passed from the callee
function (vmballoon_inflate here). So, we can determine can_sleep outside
the loop.
Signed-off-by: Rakib Mullick <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
With the arrival of concurrency-managed workqueues there is no need for
our driver to use dedicated workqueue; system-wide one should suffice just
fine.
[[email protected]: fix comment layout & grammar]
Signed-off-by: Dmitry Torokhov <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
There are two spellings in use for 'freeze' + 'able' - 'freezable' and
'freezeable'. The former is the more prominent one. The latter is
mostly used by workqueue and in a few other odd places. Unify the
spelling to 'freezable'.
Signed-off-by: Tejun Heo <[email protected]>
Reported-by: Alan Stern <[email protected]>
Acked-by: "Rafael J. Wysocki" <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Alex Dubov <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Steven Whitehouse <[email protected]>
When hypervisor decides to decrease target balloon size while the balloon
driver tries to lock pages hypervisor may respond with
VMW_BALLOON_PPN_NOTNEEDED. Use this data and immediately stop reserving
pages and wait for the next update cycle to fetch new target instead of
continuing trying to lock pages until size of refused list grows above
VMW_BALLOON_MAX_REFUSED (16) pages.
As a result the driver stops bothering the hypervisor with its attempts to
lock more pages that are not needed anymore. Most likely next order from
hypervisor will be to reduce ballon size anyway.
It is a small optimization.
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
In an effort to minimize customer confusion we want to unify naming
convention for VMware-provided kernel modules. This change renames the
balloon driver from vmware_ballon to vmw_balloon.
We expect to follow this naming convention (vmw_<module_name>) for all
modules that are part of mainline kernel and/or being distributed by
VMware, with the sole exception of vmxnet3 driver (since the name of
mainline driver happens to match with the name used in VMware Tools).
Signed-off-by: Dmitry Torokhov <[email protected]>
Acked-by: Bhavesh Davda <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>