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=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 D60C6C54FD4 for ; Wed, 25 Mar 2020 08:55:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A60002073E for ; Wed, 25 Mar 2020 08:55:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A60002073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3BDDD6B0070; Wed, 25 Mar 2020 04:55:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36D6D6B0071; Wed, 25 Mar 2020 04:55:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25BED6B0072; Wed, 25 Mar 2020 04:55:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 0DB666B0070 for ; Wed, 25 Mar 2020 04:55:42 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 833908135 for ; Wed, 25 Mar 2020 08:55:41 +0000 (UTC) X-FDA: 76633276482.13.lift18_4ec0f8815e14d X-HE-Tag: lift18_4ec0f8815e14d X-Filterd-Recvd-Size: 4712 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Mar 2020 08:55:41 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id d1so1530582wmb.2 for ; Wed, 25 Mar 2020 01:55:41 -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=Wt0uRybBOheEHQWiTml4Z1k9DiT4Y34iN3cRe7NA+hbaZUZvlnbN7FQXQq+VEAinlc NyNm7dh5lq6v1Lr/Mp1Jr2QQUGcZ1k7oUC6Ug2fBPiOYe5PuI1zOs4+GJTeC9jSpEltJ KZDS4Te6mxG518N8Scq0KJTfbvJN7fli1fXRAjlVFOKFcnwX+YOcoG3N3O2KRHTG/f18 s6Pn7qmEVBhYhuz8oJlNx9QPQuWAebSyaBUi987G7iT1CznrZeBEGIx9PEcRlxDGEa2r 4kdytzjIwmktp03N/taZOnn6l9/xzyv3G9ZB9E0XixHyu3dtj6XKWUY2/TCFMEJk9XN4 CGZQ== X-Gm-Message-State: ANhLgQ1VdwuozL1mz/UvrVXhsUomZzeFx35//DYOwxSLi9KnsBRvs4H4 QTHM0H/+hj0a2FaGLRcWNVY= X-Google-Smtp-Source: ADFU+vuA/5ocaWVVNlpCYn5BnzvuJ6qnAuLXSyHHVlX4ChU1l/XeQ0Gm6/esgK8FoNtoa2aiIXY24w== 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> 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 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