Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/vmstat.c: do not show lowmem reserve protection information of empty zone

Because the lowmem reserve protection of a zone can't tell anything if the
zone is empty, except of adding one more line in /proc/zoneinfo.

Let's remove it from that zone's showing.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/20200402140113.3696-4-bhe@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Baoquan He and committed by
Linus Torvalds
26e7dead f6366156

+6 -6
+6 -6
mm/vmstat.c
··· 1592 1592 zone->present_pages, 1593 1593 zone_managed_pages(zone)); 1594 1594 1595 + /* If unpopulated, no other information is useful */ 1596 + if (!populated_zone(zone)) { 1597 + seq_putc(m, '\n'); 1598 + return; 1599 + } 1600 + 1595 1601 seq_printf(m, 1596 1602 "\n protection: (%ld", 1597 1603 zone->lowmem_reserve[0]); 1598 1604 for (i = 1; i < ARRAY_SIZE(zone->lowmem_reserve); i++) 1599 1605 seq_printf(m, ", %ld", zone->lowmem_reserve[i]); 1600 1606 seq_putc(m, ')'); 1601 - 1602 - /* If unpopulated, no other information is useful */ 1603 - if (!populated_zone(zone)) { 1604 - seq_putc(m, '\n'); 1605 - return; 1606 - } 1607 1607 1608 1608 for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) 1609 1609 seq_printf(m, "\n %-12s %lu", zone_stat_name(i),