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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 8F769C433ED for ; Thu, 22 Apr 2021 13:42:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 001E06145B for ; Thu, 22 Apr 2021 13:42:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 001E06145B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1A05E6B006C; Thu, 22 Apr 2021 09:42:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 151766B006E; Thu, 22 Apr 2021 09:42:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 018A76B0070; Thu, 22 Apr 2021 09:42:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id DA62B6B006C for ; Thu, 22 Apr 2021 09:42:02 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 997EF8248047 for ; Thu, 22 Apr 2021 13:42:02 +0000 (UTC) X-FDA: 78060116484.40.98D6C97 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id CD191E000113 for ; Thu, 22 Apr 2021 13:41:58 +0000 (UTC) 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=5GZN6n8RFLGnbXpliy8DLvFaPZN8tEjUfgtjz00oI0k=; b=RYUcFuY5sV0XSyKeetYoyy5Qu3 8foVvGMyoLW270fBu2RKAg0u2Q9nO37gvOkWgRtq8cxyyQFsTPy+tUYL3H4qnhuZ5lL1HNZcrUcyS kVT1QcJVZpA+PE7MxNrRcqV/vQS+ZCWj7GjWp/y3b+ZR3BtQK5uGULezOEGgZdVpnFlCvyEuMZ3c7 xKw43H3kTyRyyVV5gZ67EVAEk7I4bCPeF1umnyxkT+m3sQD5/HfHXlLmZcIHLR/oJ46v+dVDmgoq4 mjQ62NcXPQi/Kzk08RIvq5LN/BlkY83RdEHtTOZsQLmGwAhUUsAsUw2uGTkqwwxFRX+aATYxlt0gq NTYxNKTA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lZZZy-000LuK-K7; Thu, 22 Apr 2021 13:41:28 +0000 Date: Thu, 22 Apr 2021 14:41:14 +0100 From: Matthew Wilcox To: Jason Gunthorpe Cc: David Hildenbrand , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: (in)consistency of page/folio function naming Message-ID: <20210422134114.GN3596236@casper.infradead.org> References: <20210422032051.GM3596236@casper.infradead.org> <20210422122117.GE2047089@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210422122117.GE2047089@ziepe.ca> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: CD191E000113 X-Stat-Signature: 4n4b1w8t89h74oa3n983p5dsfph4jqdm Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619098918-622687 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Apr 22, 2021 at 09:21:17AM -0300, Jason Gunthorpe wrote: > On Thu, Apr 22, 2021 at 11:09:45AM +0200, David Hildenbrand wrote: > > On 22.04.21 05:20, Matthew Wilcox wrote: > > > > > > I'm going through my patch queue implementing peterz's request to rename > > > FolioUptodate() as folio_uptodate(). It's going pretty well, but it > > > throws into relief all the places where we're not consistent naming > > > existing functions which operate on pages as page_foo(). The folio > > > conversion is a great opportunity to sort that out. Mostly so far, I've > > > just done s/page/folio/ on function names, but there's the opportunity to > > > regularise a lot of them, eg: > > > > > > put_page folio_put > > > lock_page folio_lock > > > lock_page_or_retry folio_lock_or_retry > > > rotate_reclaimable_page folio_rotate_reclaimable > > > end_page_writeback folio_end_writeback > > > clear_page_dirty_for_io folio_clear_dirty_for_io > > > > > > Some of these make a lot of sense -- eg when ClearPageDirty has turned > > > into folio_clear_dirty(), having folio_clear_dirty_for_io() looks regular. > > > I'm not entirely convinced about folio_lock(), but folio_lock_or_retry() > > > makes more sense than lock_page_or_retry(). Ditto _killable() or > > > _async(). > > > > > > Thoughts? > > > > I tend to like prefixes: they directly set the topic. > > > > The only thing I'm concerned is that we end up with > > > > put_page vs. folio_put > > > > which is suboptimal. > > We have this issue across the kernel already, eg kref_put() vs its > wrapper put_device() > > Personally I tend to think the regularity of 'thing'_'action' is > easier to remember than to try to guess/remember that someone judged > 'action'_'thing' to be more englishy. Mostly agree. object_verb_attribute is usually better, but i'm not changing offset_in_folio() to folio_calculate_offset() (unless someone comes up with a better name) There are also a few places where "folio" is subordinate. eg filemap_get_folio(), lruvec_stat_mod_folio()