linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Mel Gorman <mgorman@techsingularity.net>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [patch -mm] mm, vmstat: suppress pcp stats for unpopulated zones in zoneinfo
Date: Mon, 6 Mar 2017 14:03:32 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1703061400500.46428@chino.kir.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1703031451310.98023@chino.kir.corp.google.com>

After "mm, vmstat: print non-populated zones in zoneinfo", /proc/zoneinfo 
will show unpopulated zones.

The per-cpu pageset statistics are not relevant for unpopulated zones and 
can be potentially lengthy, so supress them when they are not interesting.

Also moves lowmem reserve protection information above pcp stats since it 
is relevant for all zones per vm.lowmem_reserve_ratio.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/vmstat.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/mm/vmstat.c b/mm/vmstat.c
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1392,18 +1392,24 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
 		   zone->present_pages,
 		   zone->managed_pages);
 
-	for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
-		seq_printf(m, "\n      %-12s %lu", vmstat_text[i],
-				zone_page_state(zone, i));
-
 	seq_printf(m,
 		   "\n        protection: (%ld",
 		   zone->lowmem_reserve[0]);
 	for (i = 1; i < ARRAY_SIZE(zone->lowmem_reserve); i++)
 		seq_printf(m, ", %ld", zone->lowmem_reserve[i]);
-	seq_printf(m,
-		   ")"
-		   "\n  pagesets");
+	seq_putc(m, ')');
+
+	/* If unpopulated, no other information is useful */
+	if (!populated_zone(zone)) {
+		seq_putc(m, '\n');
+		return;
+	}
+
+	for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
+		seq_printf(m, "\n      %-12s %lu", vmstat_text[i],
+				zone_page_state(zone, i));
+
+	seq_printf(m, "\n  pagesets");
 	for_each_online_cpu(i) {
 		struct per_cpu_pageset *pageset;
 

  parent reply	other threads:[~2017-03-06 22:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 23:26 [patch] mm, zoneinfo: print non-populated zones David Rientjes
2017-03-03 13:35 ` Anshuman Khandual
2017-03-03 22:46   ` David Rientjes
2017-03-03 22:53     ` [patch v2] mm, vmstat: print non-populated zones in zoneinfo David Rientjes
2017-03-04  8:21       ` Anshuman Khandual
2017-03-06 22:03       ` David Rientjes [this message]
2017-03-06 22:11         ` [patch -mm] mm, vmstat: suppress pcp stats for unpopulated " Andrew Morton
2017-03-08 14:42       ` [patch v2] mm, vmstat: print non-populated " Michal Hocko
2017-03-17  8:57         ` Michal Hocko
2017-03-17 21:21           ` David Rientjes
2017-05-03 23:41       ` [PATCH] mm, vmstat: Remove spurious WARN() during zoneinfo print Reza Arbab

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=alpine.DEB.2.10.1703061400500.46428@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=vbabka@suse.cz \
    /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).