From patchwork Tue Aug 11 07:54:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11708811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 137B813A4 for ; Tue, 11 Aug 2020 07:54:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D427F20658 for ; Tue, 11 Aug 2020 07:54:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FL+0n/G/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D427F20658 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E04BB6B0006; Tue, 11 Aug 2020 03:54:26 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D8D196B0007; Tue, 11 Aug 2020 03:54:26 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2E5D6B0008; Tue, 11 Aug 2020 03:54:26 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id A9F026B0006 for ; Tue, 11 Aug 2020 03:54:26 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5C929181AEF0B for ; Tue, 11 Aug 2020 07:54:26 +0000 (UTC) X-FDA: 77137525332.08.swim18_2b000f626fe1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 3AAF11819E773 for ; Tue, 11 Aug 2020 07:54:26 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,bhe@redhat.com,,RULES_HIT:30054:30056:30075,0,RBL:205.139.110.61:@redhat.com:.lbl8.mailshell.net-66.10.201.10 62.18.0.100;04yf45b6r9u6tr5ecskbdi5o8ib77opbtgetgg48p7tj4zatbrk88oiabbd3ee1.jb3w3uyyw84c16bxosu4xnpk3sfjcbfsadbfxgrpz99t3hcwkzst9zqcfzgkgun.g-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: swim18_2b000f626fe1 X-Filterd-Recvd-Size: 3407 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Tue, 11 Aug 2020 07:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597132465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=2TA1qUQTA106lCApZkYqx4DJzgphPi5RyaFz/tNYgI8=; b=FL+0n/G/EQEW6kbiCTWUPNwNn/+3PQe71fjzyQZccQvQf8vKi6Z2daxAwM0YA+moHrk7l4 5IaotBkgBLjWJ+NF4esB0Nuq1AM30y3PTO1VrJV5H88l2rHQOlEC3/oRQUASaTFpTayLdg v/zyksRLvvu66ds2LyFiqBJMAZSxO+I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-fTfFC_9GOue5LbbqOdFu8Q-1; Tue, 11 Aug 2020 03:54:21 -0400 X-MC-Unique: fTfFC_9GOue5LbbqOdFu8Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E62B7E919; Tue, 11 Aug 2020 07:54:19 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-96.pek2.redhat.com [10.72.13.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id E34855D9DD; Tue, 11 Aug 2020 07:54:15 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, sonnyrao@chromium.org, yuzhao@google.com, rientjes@google.com, bhe@redhat.com Subject: [PATCH] Revert "mm/vmstat.c: do not show lowmem reserve protection information of empty zone" Date: Tue, 11 Aug 2020 15:54:12 +0800 Message-Id: <20200811075412.12872-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Rspamd-Queue-Id: 3AAF11819E773 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This reverts commit 26e7deadaae1755faf1f6d1a68988c4b8348df59. Sonny reported that one of their tests started failing on the latest kernel on their Chrome OS platform. The root cause is that the above commit removed the protection line of empty zone, while the parser used in the test relies on the protection line to mark the end of each zone. Let's revert it to avoid breaking userspace testing or applications. Cc: # 5.8.x Reported-by: Sonny Rao Signed-off-by: Baoquan He Reviewed-by: David Hildenbrand Acked-by: David Rientjes --- mm/vmstat.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/vmstat.c b/mm/vmstat.c index 5b35c0eb8c57..62376dc66ec0 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1644,12 +1644,6 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat, zone->present_pages, zone_managed_pages(zone)); - /* If unpopulated, no other information is useful */ - if (!populated_zone(zone)) { - seq_putc(m, '\n'); - return; - } - seq_printf(m, "\n protection: (%ld", zone->lowmem_reserve[0]); @@ -1657,6 +1651,12 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat, seq_printf(m, ", %ld", zone->lowmem_reserve[i]); 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", zone_stat_name(i), zone_page_state(zone, i));