From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E869C433E0 for ; Tue, 11 Aug 2020 04:02:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CF1AE2054F for ; Tue, 11 Aug 2020 04:02:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="AEb9yhx4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF1AE2054F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 50C1C6B0003; Tue, 11 Aug 2020 00:02:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BCDC6B0005; Tue, 11 Aug 2020 00:02:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D2886B0006; Tue, 11 Aug 2020 00:02:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 2875B6B0003 for ; Tue, 11 Aug 2020 00:02:03 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0CEA68248047 for ; Tue, 11 Aug 2020 04:02:02 +0000 (UTC) X-FDA: 77136939684.26.bikes54_1a03d5a26fdf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id BC2151804B671 for ; Tue, 11 Aug 2020 04:02:01 +0000 (UTC) X-HE-Tag: bikes54_1a03d5a26fdf X-Filterd-Recvd-Size: 3764 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Tue, 11 Aug 2020 04:02:01 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EBCA12054F; Tue, 11 Aug 2020 04:01:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597118520; bh=pbGSN6jMtDS3O3UGeEB2J1ntE5TrgfgxfczDIgRXH9k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AEb9yhx4nLZ2/5lb/KWLC8awMCmQZzkTMi4mLP8LyhnLGuth62JR6ERetMNPNp1q0 RvPNr7CeM15RmFqoSg4di+hP8amPQC2CihsmjpbhLeVSDcSFJXHWy+JvMAvsslFp1r ZW1oWVyiyGSdJ6mz9qMvzGU6Hs8dbr0CZBBwaJpU= Date: Mon, 10 Aug 2020 21:01:59 -0700 From: Andrew Morton To: Sonny Rao Cc: Baoquan He , Yu Zhao , linux-mm@kvack.org, David Rientjes Subject: Re: ABI compatibility for /proc/zoneinfo Message-Id: <20200810210159.eff53435c407fc8afc23e4d9@linux-foundation.org> In-Reply-To: References: <20200810214614.GA1679980@google.com> <20200811023712.GB10792@MiWiFi-R3L-srv> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: BC2151804B671 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: On Mon, 10 Aug 2020 20:18:11 -0700 Sonny Rao wrote: > On Mon, Aug 10, 2020 at 7:37 PM Baoquan He wrote: > > > > On 08/10/20 at 03:46pm, Yu Zhao wrote: > > > On Mon, Aug 10, 2020 at 02:24:03PM -0700, Sonny Rao wrote: > > > > We (Chrome OS) noticed recently one of our tests started failing on > > > > upstream kernels while parsing /proc/zoneinfo > > > > I think this patch is the cause: > > > > > > > > 26e7deadaae17 mm/vmstat.c: do not show lowmem reserve protection > > > > information of empty zone > > > > > > > > Maybe our parser was being overly strict by looking for the protection > > > > line, and it's not hard to fix but raised the question of whether there's > > > > any ABI compatibility guarantees about these files? > > > > > > According to Documentation/admin-guide/sysctl/vm.rst, "Each zone has > > > an array of protection pages". I'm not sure if this is the guarantee, > > > but the doc should reflect the actual format. > > > > The current code will list all zones in one memory node, even though > > that node only has one existing zone. E.g in below node 1, > > it only has NORMAL zone, but we will list zone DMA, DMA32, MOVABLE, > > DEVICE which are all empty zone, namely doesn't exist. So, each zone > > has an array of protection pages, it should not include the nonexistent > > zone. I thought nobody would check the protection line of an empty zone, > > seems I was wrong. > > > This particular parser was written as a state machine and that line > was a convenient thing to look for to mark the end of each zone. > AFAICT, there's no explicit documentation on the layout of that file > though. This only affects 5.8 and later, yes? 26e7deadaae17 didn't gain us much at all and we shouldn't break userspace unless it's super important. So I think it's best to revert, and to backport the revert to 5.8.x. Could someone (Baoquan He?) please send a patch with a suitable changelog, cc:stable, reported-by:, etc? Thanks.