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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 85C17C433E0 for ; Sun, 14 Mar 2021 04:51:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 00D7C64EE2 for ; Sun, 14 Mar 2021 04:51:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00D7C64EE2 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 22FE96B0070; Sat, 13 Mar 2021 23:51:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 206876B0071; Sat, 13 Mar 2021 23:51:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D0286B0072; Sat, 13 Mar 2021 23:51:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id E4EB36B0070 for ; Sat, 13 Mar 2021 23:51:09 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 95E563635 for ; Sun, 14 Mar 2021 04:51:09 +0000 (UTC) X-FDA: 77917255458.03.7544189 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf09.hostedemail.com (Postfix) with ESMTP id 150D06000106 for ; Sun, 14 Mar 2021 04:51:08 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id DDB6E64E62; Sun, 14 Mar 2021 04:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1615697468; bh=SdL+heiTbcrwP9pPgOGDk7GF8R9CH7ePb0egkT7rwIw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FjRiIGqmo+zm/qULvOhmtwzrstI0hO1a31TNzjvLXf1TifOBuzX5j2rJUUZ1YC8T7 nvJGQ0hqZlUHgLYvFJWb4IheqwevpYe9QYhfWaIBk03i2DBfRyKgUizfPFMnlyznK9 tWcf6AWxSi5u7FH95jjgGCX7R41X0ff/x7xJj0uE= Date: Sat, 13 Mar 2021 20:51:07 -0800 From: Andrew Morton To: Matthew Wilcox Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v4 03/25] mm/vmstat: Add functions to account folio statistics Message-Id: <20210313205107.673f342d4bef4b2932ecd55f@linux-foundation.org> In-Reply-To: <20210314041155.GP2577561@casper.infradead.org> References: <20210305041901.2396498-1-willy@infradead.org> <20210305041901.2396498-4-willy@infradead.org> <20210313123707.231fe9852872b269a00fcc89@linux-foundation.org> <20210314041155.GP2577561@casper.infradead.org> 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-Server: rspam04 X-Rspamd-Queue-Id: 150D06000106 X-Stat-Signature: sd63tdnpad3z1ojayumf7b37xohpwifw Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615697468-696620 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 Sun, 14 Mar 2021 04:11:55 +0000 Matthew Wilcox wrote: > On Sat, Mar 13, 2021 at 12:37:07PM -0800, Andrew Morton wrote: > > On Fri, 5 Mar 2021 04:18:39 +0000 "Matthew Wilcox (Oracle)" wrote: > > > > > Allow page counters to be more readily modified by callers which have > > > a folio. Name these wrappers with 'stat' instead of 'state' as requested > > > by Linus here: > > > https://lore.kernel.org/linux-mm/CAHk-=wj847SudR-kt+46fT3+xFFgiwpgThvm7DJWGdi4cVrbnQ@mail.gmail.com/ > > > > > > --- a/include/linux/vmstat.h > > > +++ b/include/linux/vmstat.h > > > @@ -402,6 +402,54 @@ static inline void drain_zonestat(struct zone *zone, > > > struct per_cpu_pageset *pset) { } > > > #endif /* CONFIG_SMP */ > > > > > > +static inline > > > +void __inc_zone_folio_stat(struct folio *folio, enum zone_stat_item item) > > > +{ > > > + __mod_zone_page_state(folio_zone(folio), item, folio_nr_pages(folio)); > > > +} > > > > The naming is unfortunate. We expect > > > > inc: add one to > > dec: subtract one from > > mod: modify by signed quantity > > > > So these are inconsistent. Perhaps use "add" and "sub" instead. At > > least to alert people to the fact that these are different. > > > > And, again, it's nice to see the subsystem's name leading the > > identifiers, so "zone_folio_stat_add()". > > I thought this was a 'zone stat', so __zone_stat_add_folio()? > I'm not necessarily signing up to change the existing > __inc_node_page_state(), but I might. If so, __node_stat_add_page()? That works. It's the "inc means +1" and "dec means -1" whiplash that struck me the most.