Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2406815pxf; Sat, 13 Mar 2021 20:21:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGyM+5DNdih92HffsRorPGOjfLpDYa+/p/UISv321km00UysJJqJQtnqsKfLdX3oDnRQgr X-Received: by 2002:aa7:d296:: with SMTP id w22mr23834635edq.150.1615695681228; Sat, 13 Mar 2021 20:21:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615695681; cv=none; d=google.com; s=arc-20160816; b=wm72sIEjG1oTcnqw1cq3euDRlxjyCpusOaYr6Tc3XSrxUAPlp+YihsY4pQSsO0axH9 ZITvAMSDocbzVdxkMTcjrFNLA3wLh5ftVyATiG5zyJVG723LqqjqhT6EUXE6tZsH9h08 ey7RE5X5V5i0Q0lfZyxrkKfwCp07ctsGMvsN8AODtra09MVQWNjco1pdNh4soKEo/C+O l4yvbu4/2U6zQ7MxCH+fYWIgsE+wrLlz8eqRZuaxZfEltTVKE9rKHB/aEHEmLebELfj9 Par9G0tD9ZiXSWJCN3QsQ3/ozzA7VK9uORTFvtli4NGlcL4CP7OxCiIIZfMuYz+mObgX Mn+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=02jgM/7ByYHgEtTryAQckCxQUmrHridrlm+xFZ5jOkE=; b=tW6SDzcHYfrJYa7zBpEc0HskQWBaWypqgrhl97xB4hEPy5SbYE2lqwnCB+M5k3s1Yk s6JBGPAOkq4kpiRLYHX3iDG8T00JwB0rNd0yghUvnCp/yLajeOmiXifq7NPXa16sWMn6 a7B0woauUlBCLHygmbWPgT8gIt6rbxB6s0rhzAePqSYZk9Tx8DmQCG5G0EzlPmCuX1Be NPjMeWRsQFPd1ZmQoB+LXKHwB+6Aj3hIHtJxrPF0jwoJCmWlXeQmKYA/3BZYHBcPCeqQ wEjsBatieOYWmiAo0h3xxhuhZCyhFajrpBJu4Vfb0GFPaUJ6TdGKiyPpjWXzBmT96RHa P/kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Vh9jIURF; 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 y1si7914876edp.405.2021.03.13.20.20.58; Sat, 13 Mar 2021 20:21:21 -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=@infradead.org header.s=casper.20170209 header.b=Vh9jIURF; 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 S234950AbhCNEM1 (ORCPT + 99 others); Sat, 13 Mar 2021 23:12:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234941AbhCNEMJ (ORCPT ); Sat, 13 Mar 2021 23:12:09 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE863C061574; Sat, 13 Mar 2021 20:12:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=02jgM/7ByYHgEtTryAQckCxQUmrHridrlm+xFZ5jOkE=; b=Vh9jIURFq7H64sfFuYM3dyj+gH EqZ+P5PatjvVgG8RRjDFxFsp0IETWf19ZavYwd07/Gz1Ud6lFQxi6eM/LHblG/UgvFvU6JtpGqNJ9 s3WeyRblL8QMjOJ2NYycDb0xLkzf6J+ZwlooyrTNhn7jxATSLTVqJb/zjkADLikWEfTURw61zA6Wd nZzsogrO9XIe5wMZ7De4MVDE/neCSSdd2uDpM4pTGWOfsYphEOvId51WaS/O2TrqrJscPugCLz/9S moBQ4oJfeY0bK8sJ4Cn4aEnLtvfaEu7gbqRMfsZHWiszkyPlcy+CokVNTnumseEdjJessOwVgq+QF 1mj2H7lA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lLI6d-00FWm2-Ih; Sun, 14 Mar 2021 04:11:57 +0000 Date: Sun, 14 Mar 2021 04:11:55 +0000 From: Matthew Wilcox To: Andrew Morton 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: <20210314041155.GP2577561@casper.infradead.org> References: <20210305041901.2396498-1-willy@infradead.org> <20210305041901.2396498-4-willy@infradead.org> <20210313123707.231fe9852872b269a00fcc89@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210313123707.231fe9852872b269a00fcc89@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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()?