linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Atanasov <alexander.atanasov@virtuozzo.com>
To: unlisted-recipients:; (no To-header on input)
Cc: kernel@openvz.org,
	Alexander Atanasov <alexander.atanasov@virtuozzo.com>,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH v5 4/8] mm: Display inflated memory in logs
Date: Wed, 19 Oct 2022 12:56:16 +0300	[thread overview]
Message-ID: <20221019095620.124909-5-alexander.atanasov@virtuozzo.com> (raw)
In-Reply-To: <20221019095620.124909-1-alexander.atanasov@virtuozzo.com>

Add InflatedTotal and InflatedFree to show_mem(...) so
it is visible in the logs.

Signed-off-by: Alexander Atanasov <alexander.atanasov@virtuozzo.com>
---
 lib/show_mem.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/show_mem.c b/lib/show_mem.c
index 0d7585cde2a6..20b5964d498e 100644
--- a/lib/show_mem.c
+++ b/lib/show_mem.c
@@ -7,6 +7,9 @@
 
 #include <linux/mm.h>
 #include <linux/cma.h>
+#ifdef CONFIG_MEMORY_BALLOON
+#include <linux/balloon.h>
+#endif
 
 void __show_mem(unsigned int filter, nodemask_t *nodemask, int max_zone_idx)
 {
@@ -41,4 +44,9 @@ void __show_mem(unsigned int filter, nodemask_t *nodemask, int max_zone_idx)
 #ifdef CONFIG_MEMORY_FAILURE
 	printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages));
 #endif
+#ifdef CONFIG_MEMORY_BALLOON
+	printk("Balloon InflatedTotal:%ldkB InflatedFree:%ldkB\n",
+		atomic_long_read(&mem_balloon_inflated_total_kb),
+		atomic_long_read(&mem_balloon_inflated_free_kb));
+#endif
 }
-- 
2.31.1


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

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221019095620.124909-1-alexander.atanasov@virtuozzo.com>
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 ` [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 ` Alexander Atanasov [this message]
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

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=20221019095620.124909-5-alexander.atanasov@virtuozzo.com \
    --to=alexander.atanasov@virtuozzo.com \
    --cc=kernel@openvz.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).