Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2418693pxf; Sat, 13 Mar 2021 20:58:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpFFQ/KD//pnYesY/xW4uiEBvam6Jlutq11ykMa8eY62/uZGszieuu/VK+3Nlf8OdC76It X-Received: by 2002:a05:6402:220a:: with SMTP id cq10mr23105018edb.345.1615697931776; Sat, 13 Mar 2021 20:58:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615697931; cv=none; d=google.com; s=arc-20160816; b=XSS/eqQrki2YgENf7cyn1HqsKwL0ClQGnwbmXeVpm5Q0IU6QL/L0amnJbUBYOdyJG9 jTmSPBorn1eG3RhTMyndmsb/fPEF+0brVASoMA/N11QTrkpz3fe50bZy1Km/hsWC5NRk coCosVd94KYWUS7skSFI/KeFKfniULI5R5cAMLlYLMVVIUyiWpj+jgVEvT8IuwZcps5V s+kNOOZfvZGXzMCbE5DsV5fkM1EdLp12bsBrFNOfnk0RkptW7dhSD1dAK+5FCjjBjyHu FMY+Mz5aiR3hy5ujxBuIbmEvfFQCUucqfg5hBiSKe6K3PXMulZA6Erao+LgCKDBvMk+W AXag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=G/n9Sv4tmkT/y17i2E/vXRpSSRcIPgI79KVqC0RyciI=; b=eAUnVxlvMY1EPJoZ40B/wq56+vKFgwFZAYD5JgyoiXtwdM2fVp3/1Vs+cNqXSh0oQU jXzzKIbU2R0eh6OG/SvI0TVEb5dUba0qn3MEFTwxdteQ+B0lv3h/4hrrchH7JuzICShi Z1btazUtOqpzLRPOPXpq93HhGFkMXiqVm/UJ7YZyjmDTpD/IybRjWJTWnHvpqJVUG4qL W6VFpUH0sajClfLQB0PLtfrTP8BZASdY5XzJcyl054AFoeIxkFNbihwzNLuh6Npm6MHw WcdPxP2U0Kj+YZ2bhLSkzuy2MOQNdS/oNmc9fe39R6Xu1IRth6K1nHE9BqDA7V7P9Uu1 A7Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=FjRiIGqm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h26si7862236edw.139.2021.03.13.20.58.29; Sat, 13 Mar 2021 20:58:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=FjRiIGqm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234935AbhCNEvZ (ORCPT + 99 others); Sat, 13 Mar 2021 23:51:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:50502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231756AbhCNEvI (ORCPT ); Sat, 13 Mar 2021 23:51:08 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.