Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp399153ybb; Wed, 25 Mar 2020 01:56:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvXBUSYRjhbVAHxPj0/n2J9VRmsybjofqpe+3LAxchW8nZHaXRshL6glNd7WKnQE/90KgL+ X-Received: by 2002:a05:6808:b1a:: with SMTP id s26mr1633622oij.150.1585126596711; Wed, 25 Mar 2020 01:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585126596; cv=none; d=google.com; s=arc-20160816; b=BaycBSbgPjwwAd0ipuZzS3+5raCWihfRnC1bPtV9iXh3P+ZSNk9U+F9Fa6WFXr5iV6 /c9P2bDWumKHcfsNHIH7dJw5X+JQi8Was74k7qus37dU2Uws5/CpCi0Wryqv2u+xgouY Bn5053yx3Z5pkw3WVVgRh7DYIGXlQQ+qScwrFZRkhToE2XPq1gQ2bLEt/QXJhPtTpzE+ mejNLPQ8mJaThbEtWmMD6l2lBW8WcJ1Dmjk3cpsRzZuOl5BSjAANC5V9aqs5YEfcq/9z ROrv3B1b/e3APlhUL5na3/vQdjWHXfwmpSuYuxbk+SFOpgoruvTh049YN2iAYEk55iZq CMQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=A0OMbVybEpaW+w1C0n6/qu2u7s7M3HMJ+OsMULSR4sI=; b=ebD5g4ovmbL/+te/gB2SFLWPP8XeYWBB3m1F6iaDcga2yT/G79ptstal4jVlZ2wgue e2XW17D+qX1oPAlR7YuY+K9Kj11xcHVyWOX8bC0WKS9bbMItF1IEwC/Xj9FVZ8FPuEn5 BP+oVJyqasv1oPz9uw3WYf3dUgBqqEbTJoemfI0WeWlj4F9sDOvpO/HUPOQyiiYDiyAw 1MRSFe3C51JCp56K2a4jkTcsP75VnrtG7V2PV2IbZlbQWnR9VZSnfV/8LUiMRQHSKj8c nbdHSaPSgm7iyA+FNDRpRfCr7u1iDAjsg7rD0JPyIU+3ZEJBvCOJzDKqvUeIiy7gqkyp 4Maw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w83si9914788oie.244.2020.03.25.01.56.25; Wed, 25 Mar 2020 01:56:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727559AbgCYIzp (ORCPT + 99 others); Wed, 25 Mar 2020 04:55:45 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:33512 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727301AbgCYIzm (ORCPT ); Wed, 25 Mar 2020 04:55:42 -0400 Received: by mail-wm1-f67.google.com with SMTP id w25so1577915wmi.0 for ; Wed, 25 Mar 2020 01:55:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A0OMbVybEpaW+w1C0n6/qu2u7s7M3HMJ+OsMULSR4sI=; b=INatbJ1zpjx/upydrHaGJRlTY0MoG/t1dP7z2pQMcKrRZpC2FoULfdiepFwso432T3 pKsYilMPbVAQiksfTNVTwIm1mYyzzjNwDNw5cUARtWf0AcdpdK1bh525ghcxI6MAcwRp /OAEGnvOoyl0U8dV82Sq2K3N9nTYYoXK2KdosKfjqev9FEZRA6BvPiEzSa1O+wC9n5AU Oj7AXgr1SDdlQ71TJLL/obmZOrFzd4+cUm5u1z0VP9r4Ol+4racqqNYU9KlKZ7zDzYEc geXhCCuOgPyI1wJtm79qRy/qtQVbYBdAF/tfN38S70nj4/Dsedr/I623Z6bKOzWtJmu/ XHng== X-Gm-Message-State: ANhLgQ3E6kRyB7WOd2f1l4RDrfn7twD+bs+UZQpzyF2UQXdBySF5LUJ/ j6o30Wz66Smb/rWPQnR8Dqo= X-Received: by 2002:a1c:2e92:: with SMTP id u140mr2384030wmu.84.1585126540155; Wed, 25 Mar 2020 01:55:40 -0700 (PDT) Received: from localhost (ip-37-188-135-150.eurotel.cz. [37.188.135.150]) by smtp.gmail.com with ESMTPSA id t193sm8428993wmt.14.2020.03.25.01.55.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 01:55:39 -0700 (PDT) Date: Wed, 25 Mar 2020 09:55:37 +0100 From: Michal Hocko To: Baoquan He Cc: David Rientjes , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, iamjoonsoo.kim@lge.com, hannes@cmpxchg.org, vbabka@suse.cz Subject: Re: [PATCH 4/5] mm/vmstat.c: move the per-node stats to the front of /proc/zoneinfo Message-ID: <20200325085537.GZ19542@dhcp22.suse.cz> References: <20200324142229.12028-1-bhe@redhat.com> <20200324142229.12028-5-bhe@redhat.com> <20200325055331.GB9942@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200325055331.GB9942@MiWiFi-R3L-srv> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 25-03-20 13:53:31, Baoquan He wrote: > On 03/24/20 at 12:25pm, David Rientjes wrote: > > On Tue, 24 Mar 2020, Baoquan He wrote: > > > > > This moving makes the layout of /proc/zoneinfo more sensible. And there > > > are 4 zones at most currently, it doesn't need to scroll down much to get > > > to the 1st populated zone, even though the 1st populated zone is MOVABLE > > > zone. > > > > > > > Doesn't this introduce risk that it will break existing parsers of > > /proc/zoneinfo in subtle ways? > > > > In some cases /proc/zoneinfo is a tricky file to correctly parse because > > you have to rely on the existing order in which it is printed to determine > > which zone is being described. We need to print zones even with unmanaged > > pages, for instance, otherwise userspace may be unaware of which zones are > > supported and what order they are in. That's important to be able to > > construct the proper string to use when writing vm.lowmem_reserve_ratio. > > > > I'd prefer not changing the order of /proc/zoneinfo if it can be avoided > > just because the risk outweighs the reward that we may break some > > initscript parsers. > > Oh, I may not describe the change and result clearly. This patch doesn't > change zone order at all. I only move the per-node stats to the front of > each node, the zone order is completely kept the same, still DMA, DMA32, > NORMAL, MOVABLE. Even this can break existing parsers. Fixing that up is likely not hard and existing parsers would be mostly debugging hacks here and there but I do miss any actual justification except for you considering it more sensible. I do not remember this would be a common pain point for people parsing this file. If anything the overal structure of the file makes it hard to parse and your patches do not really address that. We are likely too late to make the output much more sensible TBH. That being said, I haven't looked more closely on your patches because I do not have spare cycles for that. Your justification for touching the code which seems to be working relatively well is quite weak IMHO, yet it adds a non zero risk for breaking existing parsers. -- Michal Hocko SUSE Labs