[PATCH v3 0/4] Make balloon drivers memory changes known to the rest of the kernel

Alexander Atanasov posted 4 patches 1 year, 8 months ago
Only 0 patches received!
There is a newer version of this series
Documentation/filesystems/proc.rst            |  6 +++
MAINTAINERS                                   |  4 +-
arch/powerpc/platforms/pseries/cmm.c          |  2 +-
drivers/misc/vmw_balloon.c                    |  2 +-
drivers/virtio/virtio_balloon.c               |  7 +++-
fs/proc/meminfo.c                             | 10 +++++
.../linux/{balloon_compaction.h => balloon.h} | 30 ++++++++++----
mm/Makefile                                   |  2 +-
mm/{balloon_compaction.c => balloon.c}        | 40 +++++++++++++++++--
mm/migrate.c                                  |  1 -
mm/vmscan.c                                   |  1 -
11 files changed, 87 insertions(+), 18 deletions(-)
rename include/linux/{balloon_compaction.h => balloon.h} (86%)
rename mm/{balloon_compaction.c => balloon.c} (88%)
[PATCH v3 0/4] Make balloon drivers memory changes known to the rest of the kernel
Posted by Alexander Atanasov 1 year, 8 months ago
Currently balloon drivers (Virtio,XEN, HyperV, VMWare, ...)
inflate and deflate the guest memory size but there is no
way to know how much the memory size is changed by them.

A common use of the ballooning is to emulate [1]
hot plug and hot unplug - due to the complexity of the later.
Hotplug has a notifier and one can also check the updated
memory size.

To improve this add InflatedTotal and InflatedFree
to /proc/meminfo and implement a balloon notifier.

Amount of inflated memory can be used:
 - si_meminfo(..) users can improve calculations
 - adjust cache/buffer sizes
 - adjust object/connection limits
 - as a hint for the oom a killer
 - by user space software that monitors memory pressure

Patches for the other balloon drivers will be done next.

Alexander Atanasov (4):
  Make place for common balloon code
  Enable balloon drivers to report inflated memory
  Display inflated memory to users
  drivers: virtio: balloon - update inflated memory

 Documentation/filesystems/proc.rst            |  6 +++
 MAINTAINERS                                   |  4 +-
 arch/powerpc/platforms/pseries/cmm.c          |  2 +-
 drivers/misc/vmw_balloon.c                    |  2 +-
 drivers/virtio/virtio_balloon.c               |  7 +++-
 fs/proc/meminfo.c                             | 10 +++++
 .../linux/{balloon_compaction.h => balloon.h} | 30 ++++++++++----
 mm/Makefile                                   |  2 +-
 mm/{balloon_compaction.c => balloon.c}        | 40 +++++++++++++++++--
 mm/migrate.c                                  |  1 -
 mm/vmscan.c                                   |  1 -
 11 files changed, 87 insertions(+), 18 deletions(-)
 rename include/linux/{balloon_compaction.h => balloon.h} (86%)
 rename mm/{balloon_compaction.c => balloon.c} (88%)

v2:
 - reworked from simple /proc/meminfo addition
v3:
 - added missed EXPORT_SYMBOLS
Reported-by: kernel test robot <lkp@intel.com>
 - instead of balloon_common.h just use balloon.h (yes, naming is hard)
 - cleaned up balloon.h - remove from files that do not use it and
   remove externs from function declarations

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Wei Liu <wei.liu@kernel.org>
Cc: Nadav Amit <namit@vmware.com>
Cc: pv-drivers@vmware.com
Cc: Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Dexuan Cui <decui@microsoft.com>
Cc: linux-hyperv@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: xen-devel@lists.xenproject.org

base-commit: 1c23f9e627a7b412978b4e852793c5e3c3efc555
-- 
2.31.1