All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@virtuozzo.com>
To: Konstantin Khlebnikov <koct9i@gmail.com>,
	Alexander Atanasov <alexander.atanasov@virtuozzo.com>
Cc: kernel@openvz.org, kernel test robot <lkp@intel.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	David Hildenbrand <david@redhat.com>,
	Wei Liu <wei.liu@kernel.org>, Nadav Amit <namit@vmware.com>,
	pv-drivers@vmware.com, Jason Wang <jasowang@redhat.com>,
	virtualization@lists.linux-foundation.org,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Dexuan Cui <decui@microsoft.com>,
	linux-hyperv@vger.kernel.org, Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [RFC PATCH v5 0/8] Make balloon drivers' memory changes known to the rest of the kernel
Date: Wed, 19 Oct 2022 13:06:02 +0200	[thread overview]
Message-ID: <1c69ff97-831d-ece3-7a52-bb7659fc8dd4@virtuozzo.com> (raw)
In-Reply-To: <CALYGNiONv3au6hbAva60jWurwkU5ancWo-o2v7tpSzwguqzD9g@mail.gmail.com>

On 10/19/22 12:53, Konstantin Khlebnikov wrote:
> On Wed, 19 Oct 2022 at 12:57, Alexander Atanasov 
> <alexander.atanasov@virtuozzo.com> wrote:
>
>     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.
>
>     Make it possible for the drivers to report the values to mm core.
>
>     Display reported InflatedTotal and InflatedFree in /proc/meminfo
>     and print these values on OOM and sysrq from show_mem().
>
>     The two values are the result of the two modes the drivers work
>     with using adjust_managed_page_count or without.
>
>     In earlier versions, there was a notifier for these changes
>     but after discussion - it is better to implement it in separate
>     patch series. Since it came out as larger work than initially
>     expected.
>
>     Amount of inflated memory can be used:
>      - totalram_pages() users working with drivers not using
>         adjust_managed_page_count
>      - si_meminfo(..) users can improve calculations
>      - by userspace software that monitors memory pressure
>
>
> Sorry, I see no reason for that series.
> Balloon inflation adjusts totalram_pages. That's enough.
>
no, they are not at least under some circumstances, f.e.
virtio balloon does not do that with VIRTIO_BALLOON_F_DEFLATE_ON_OOM
set

> There is no reason to know the amount of non-existent ballooned memory 
> inside.
> Management software which works outside should care about that.
>
The problem comes at the moment when we are running
our Linux server inside virtual machine and the customer
comes with crazy questions "where our memory?".

> For debugging you could get current balloon size from /proc/vmstat 
> (balloon_inflate - balloon_deflate).
> Also (I guess) /proc/kpageflags has a bit for that.
>
> Anyway it's easy to monitor balloon inflation by seeing changes of 
> total memory size.
for monitoring - may be. But in order to report total amount
there is no interface so far.

>
>     Alexander Atanasov (8):
>       mm: Make a place for a common balloon code
>       mm: Enable balloon drivers to report inflated memory
>       mm: Display inflated memory to users
>       mm: Display inflated memory in logs
>       drivers: virtio: balloon - report inflated memory
>       drivers: vmware: balloon - report inflated memory
>       drivers: hyperv: balloon - report inflated memory
>       documentation: create a document about how balloon drivers operate
>
>      Documentation/filesystems/proc.rst            |   6 +
>      Documentation/mm/balloon.rst                  | 138
>     ++++++++++++++++++
>      MAINTAINERS                                   |   4 +-
>      arch/powerpc/platforms/pseries/cmm.c          |   2 +-
>      drivers/hv/hv_balloon.c                       |  12 ++
>      drivers/misc/vmw_balloon.c                    |   3 +-
>      drivers/virtio/virtio_balloon.c               |   7 +-
>      fs/proc/meminfo.c                             |  10 ++
>      .../linux/{balloon_compaction.h => balloon.h} |  18 ++-
>      lib/show_mem.c                                |   8 +
>      mm/Makefile                                   |   2 +-
>      mm/{balloon_compaction.c => balloon.c}        |  19 ++-
>      mm/migrate.c                                  |   1 -
>      mm/vmscan.c                                   |   1 -
>      14 files changed, 213 insertions(+), 18 deletions(-)
>      create mode 100644 Documentation/mm/balloon.rst
>      rename include/linux/{balloon_compaction.h => balloon.h} (91%)
>      rename mm/{balloon_compaction.c => balloon.c} (94%)
>
>     v4->v5:
>      - removed notifier
>      - added documentation
>      - vmware update after op is done , outside of the mutex
>     v3->v4:
>      - add support in hyperV and vmware balloon drivers
>      - display balloon memory in show_mem so it is logged on OOM and
>     on sysrq
>     v2->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
>     v1->v2:
>      - reworked from simple /proc/meminfo addition
>
>     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: 9abf2313adc1ca1b6180c508c25f22f9395cc780
>     -- 
>     2.31.1
>


WARNING: multiple messages have this Message-ID (diff)
From: "Denis V. Lunev via Virtualization" <virtualization@lists.linux-foundation.org>
To: Konstantin Khlebnikov <koct9i@gmail.com>,
	Alexander Atanasov <alexander.atanasov@virtuozzo.com>
Cc: Juergen Gross <jgross@suse.com>, Wei Liu <wei.liu@kernel.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	kernel test robot <lkp@intel.com>,
	pv-drivers@vmware.com, "Michael S . Tsirkin" <mst@redhat.com>,
	Dexuan Cui <decui@microsoft.com>,
	linux-hyperv@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Nadav Amit <namit@vmware.com>,
	xen-devel@lists.xenproject.org, kernel@openvz.org,
	Haiyang Zhang <haiyangz@microsoft.com>
Subject: Re: [RFC PATCH v5 0/8] Make balloon drivers' memory changes known to the rest of the kernel
Date: Wed, 19 Oct 2022 13:06:02 +0200	[thread overview]
Message-ID: <1c69ff97-831d-ece3-7a52-bb7659fc8dd4@virtuozzo.com> (raw)
In-Reply-To: <CALYGNiONv3au6hbAva60jWurwkU5ancWo-o2v7tpSzwguqzD9g@mail.gmail.com>

On 10/19/22 12:53, Konstantin Khlebnikov wrote:
> On Wed, 19 Oct 2022 at 12:57, Alexander Atanasov 
> <alexander.atanasov@virtuozzo.com> wrote:
>
>     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.
>
>     Make it possible for the drivers to report the values to mm core.
>
>     Display reported InflatedTotal and InflatedFree in /proc/meminfo
>     and print these values on OOM and sysrq from show_mem().
>
>     The two values are the result of the two modes the drivers work
>     with using adjust_managed_page_count or without.
>
>     In earlier versions, there was a notifier for these changes
>     but after discussion - it is better to implement it in separate
>     patch series. Since it came out as larger work than initially
>     expected.
>
>     Amount of inflated memory can be used:
>      - totalram_pages() users working with drivers not using
>         adjust_managed_page_count
>      - si_meminfo(..) users can improve calculations
>      - by userspace software that monitors memory pressure
>
>
> Sorry, I see no reason for that series.
> Balloon inflation adjusts totalram_pages. That's enough.
>
no, they are not at least under some circumstances, f.e.
virtio balloon does not do that with VIRTIO_BALLOON_F_DEFLATE_ON_OOM
set

> There is no reason to know the amount of non-existent ballooned memory 
> inside.
> Management software which works outside should care about that.
>
The problem comes at the moment when we are running
our Linux server inside virtual machine and the customer
comes with crazy questions "where our memory?".

> For debugging you could get current balloon size from /proc/vmstat 
> (balloon_inflate - balloon_deflate).
> Also (I guess) /proc/kpageflags has a bit for that.
>
> Anyway it's easy to monitor balloon inflation by seeing changes of 
> total memory size.
for monitoring - may be. But in order to report total amount
there is no interface so far.

>
>     Alexander Atanasov (8):
>       mm: Make a place for a common balloon code
>       mm: Enable balloon drivers to report inflated memory
>       mm: Display inflated memory to users
>       mm: Display inflated memory in logs
>       drivers: virtio: balloon - report inflated memory
>       drivers: vmware: balloon - report inflated memory
>       drivers: hyperv: balloon - report inflated memory
>       documentation: create a document about how balloon drivers operate
>
>      Documentation/filesystems/proc.rst            |   6 +
>      Documentation/mm/balloon.rst                  | 138
>     ++++++++++++++++++
>      MAINTAINERS                                   |   4 +-
>      arch/powerpc/platforms/pseries/cmm.c          |   2 +-
>      drivers/hv/hv_balloon.c                       |  12 ++
>      drivers/misc/vmw_balloon.c                    |   3 +-
>      drivers/virtio/virtio_balloon.c               |   7 +-
>      fs/proc/meminfo.c                             |  10 ++
>      .../linux/{balloon_compaction.h => balloon.h} |  18 ++-
>      lib/show_mem.c                                |   8 +
>      mm/Makefile                                   |   2 +-
>      mm/{balloon_compaction.c => balloon.c}        |  19 ++-
>      mm/migrate.c                                  |   1 -
>      mm/vmscan.c                                   |   1 -
>      14 files changed, 213 insertions(+), 18 deletions(-)
>      create mode 100644 Documentation/mm/balloon.rst
>      rename include/linux/{balloon_compaction.h => balloon.h} (91%)
>      rename mm/{balloon_compaction.c => balloon.c} (94%)
>
>     v4->v5:
>      - removed notifier
>      - added documentation
>      - vmware update after op is done , outside of the mutex
>     v3->v4:
>      - add support in hyperV and vmware balloon drivers
>      - display balloon memory in show_mem so it is logged on OOM and
>     on sysrq
>     v2->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
>     v1->v2:
>      - reworked from simple /proc/meminfo addition
>
>     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: 9abf2313adc1ca1b6180c508c25f22f9395cc780
>     -- 
>     2.31.1
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2022-10-19 11:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  9:56 [RFC PATCH v5 0/8] Make balloon drivers' memory changes known to the rest of the kernel Alexander Atanasov
2022-10-19  9:56 ` Alexander Atanasov
2022-10-19  9:56 ` [RFC PATCH v5 1/8] mm: Make a place for a common balloon code Alexander Atanasov
2022-10-19  9:56   ` Alexander Atanasov
2022-10-19  9:56 ` [RFC PATCH v5 2/8] mm: Enable balloon drivers to report inflated memory Alexander Atanasov
2022-10-19  9:56 ` [RFC PATCH v5 3/8] mm: Display inflated memory to users Alexander Atanasov
2022-10-19  9:56 ` [RFC PATCH v5 4/8] mm: Display inflated memory in logs Alexander Atanasov
2022-10-19  9:56 ` [RFC PATCH v5 5/8] drivers: virtio: balloon - report inflated memory Alexander Atanasov
2022-10-19  9:56 ` [RFC PATCH v5 6/8] drivers: vmware: " Alexander Atanasov
2022-10-19 10:26   ` Greg Kroah-Hartman
2022-10-19 10:38     ` Alexander Atanasov
2022-10-19 10:49       ` Greg Kroah-Hartman
2022-10-19 11:06         ` Alexander Atanasov
2022-10-21  6:50   ` Nadav Amit
2022-10-21  7:25     ` Alexander Atanasov
2022-10-21  7:31       ` Nadav Amit
2022-10-21  8:02         ` Alexander Atanasov
2022-10-19  9:56 ` [RFC PATCH v5 7/8] drivers: hyperv: " Alexander Atanasov
2022-10-19  9:56 ` [RFC PATCH v5 8/8] documentation: create a document about how balloon drivers operate Alexander Atanasov
2022-10-19 13:53   ` Jonathan Corbet
2022-10-19 10:53 ` [RFC PATCH v5 0/8] Make balloon drivers' memory changes known to the rest of the kernel Konstantin Khlebnikov
2022-10-19 10:53   ` Konstantin Khlebnikov
2022-10-19 11:06   ` Denis V. Lunev [this message]
2022-10-19 11:06     ` Denis V. Lunev via Virtualization
2022-10-19 15:39     ` Konstantin Khlebnikov
2022-10-19 15:39       ` Konstantin Khlebnikov
2022-10-19 18:03       ` Alexander Atanasov
2022-10-19 11:44   ` Alexander Atanasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c69ff97-831d-ece3-7a52-bb7659fc8dd4@virtuozzo.com \
    --to=den@virtuozzo.com \
    --cc=alexander.atanasov@virtuozzo.com \
    --cc=david@redhat.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=jasowang@redhat.com \
    --cc=jgross@suse.com \
    --cc=kernel@openvz.org \
    --cc=koct9i@gmail.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mst@redhat.com \
    --cc=namit@vmware.com \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=pv-drivers@vmware.com \
    --cc=sstabellini@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wei.liu@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.