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=INCLUDES_PATCH, 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 A10BCC2BA18 for ; Mon, 6 Apr 2020 07:41:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6695320672 for ; Mon, 6 Apr 2020 07:41:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6695320672 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 07A5B8E000E; Mon, 6 Apr 2020 03:41:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 029E38E000D; Mon, 6 Apr 2020 03:41:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EAA358E000E; Mon, 6 Apr 2020 03:41:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id D3E198E000D for ; Mon, 6 Apr 2020 03:41:22 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8FC40180AD801 for ; Mon, 6 Apr 2020 07:41:22 +0000 (UTC) X-FDA: 76676634804.16.burst35_8063e9aaf4343 X-HE-Tag: burst35_8063e9aaf4343 X-Filterd-Recvd-Size: 5000 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 07:41:22 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id j17so16076962wru.13 for ; Mon, 06 Apr 2020 00:41:22 -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=nAQr+9K38MgvDYYgFchl8YBFkKBoGytRmVlPwECNUXM=; b=bhb7vmAKVnDMDW5yXldT4znwh4WfMynpSBthogx4X0/pXELbloPBLiKAJHZKDHWyyL Y5RE1jpecN7ujbUVu0opH5P1TJ14P8FXVoVGbLBtiEiuz4k1EeKJmnerdTozH0W3J+5G 3+0MvKNQQxbIqakWdIg2Ks0b9IHw7y6pDzvRNGeYx2A9MVFOLm/gNyEaSkz6KosJtAQ3 QiTdf6dDLaQYchnHphn6v0e8qAbK7jUVv+vy0aiP5n3kDS11+XVaoDPiya8Zq5YSGv6R y40o4g4hd7q9JAWtRvKw9ANZB3APEYImJMhS0I5fHHL+ErCeLpqSOsFBEzAx2DjlJYPx MVjQ== X-Gm-Message-State: AGi0Pubgn42je9mxyqzBIO6IZsWgjxqeS+xUVLMcmSJUYSB4tOeBYNrB sVO6gSbTKRSitnqqVBGEHVE= X-Google-Smtp-Source: APiQypKPzaN/Qn9P7OD6uTxybVieU5yFLGLohLtLIFIR3egzCrHscNwlVQ/Uk9zL2X5VoX0jhSBGrA== X-Received: by 2002:adf:904e:: with SMTP id h72mr4288049wrh.367.1586158881210; Mon, 06 Apr 2020 00:41:21 -0700 (PDT) Received: from localhost (ip-37-188-180-223.eurotel.cz. [37.188.180.223]) by smtp.gmail.com with ESMTPSA id o129sm15907239wma.20.2020.04.06.00.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 00:41:20 -0700 (PDT) Date: Mon, 6 Apr 2020 09:41:19 +0200 From: Michal Hocko To: NeilBrown Cc: Jan Kara , Christoph Hellwig , Trond Myklebust , "Anna.Schumaker@Netapp.com" , Andrew Morton , linux-mm@kvack.org, linux-nfs@vger.kernel.org, LKML Subject: Re: [PATCH 2/2 - v2] MM: Discard NR_UNSTABLE_NFS, use NR_WRITEBACK instead. Message-ID: <20200406074119.GG19426@dhcp22.suse.cz> References: <87tv2b7q72.fsf@notabene.neil.brown.name> <87v9miydai.fsf@notabene.neil.brown.name> <87sghmyd8v.fsf@notabene.neil.brown.name> <87pncqyd7k.fsf@notabene.neil.brown.name> <20200402151009.GA14130@infradead.org> <87h7y1y0ra.fsf@notabene.neil.brown.name> <20200403094220.GA29920@quack2.suse.cz> <20200403110358.GB22681@dhcp22.suse.cz> <87pnclwjvr.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pnclwjvr.fsf@notabene.neil.brown.name> 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 06-04-20 10:14:16, Neil Brown wrote: > On Fri, Apr 03 2020, Michal Hocko wrote: > > > On Fri 03-04-20 11:42:20, Jan Kara wrote: > > [...] > >> > diff --git a/mm/vmstat.c b/mm/vmstat.c > >> > index 78d53378db99..d1291537bbb9 100644 > >> > --- a/mm/vmstat.c > >> > +++ b/mm/vmstat.c > >> > @@ -1162,7 +1162,6 @@ const char * const vmstat_text[] = { > >> > "nr_file_hugepages", > >> > "nr_file_pmdmapped", > >> > "nr_anon_transparent_hugepages", > >> > - "nr_unstable", > >> > "nr_vmscan_write", > >> > "nr_vmscan_immediate_reclaim", > >> > "nr_dirtied", > >> > >> This is probably the most tricky to deal with given how /proc/vmstat is > >> formatted. OTOH for this file there's good chance we'd get away with just > >> deleting nr_unstable line because there are entries added to it in the > >> middle (e.g. in 60fbf0ab5da1 last September) and nobody complained yet. > >> > >> What do mm people think? How were changes to vmstat counters handled in the > >> past? > > > > Adding new counters in the middle seems to be generally OK. I would be > > more worried about removing counters though. So if we can simply print a > > phone value at the very end then this should be a reasonable workaround. > > At the very end? > Do you mean not have "nr_unstable 0" appear at all, but having "dummy 0" > appear at the end just so that the number of lines doesn't decrease? > Am I misunderstanding? Sorry for not being clear. I meant semething like diff --git a/mm/vmstat.c b/mm/vmstat.c index 78d53378db99..836e3f7a7aff 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1705,8 +1705,16 @@ static void *vmstat_start(struct seq_file *m, loff_t *pos) static void *vmstat_next(struct seq_file *m, void *arg, loff_t *pos) { (*pos)++; - if (*pos >= NR_VMSTAT_ITEMS) + if (*pos >= NR_VMSTAT_ITEMS) { + /* + * deprecated counters which are no longer represented + * in vmstat arrays. We just lie about them to be always + * 0 to not break userspace which might expect them in + * int the output. + */ + seq_puts(m, "nr_unstable 0") return NULL; + } return (unsigned long *)m->private + *pos; } -- Michal Hocko SUSE Labs