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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 4852EC433ED for ; Thu, 22 Apr 2021 15:55:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A25E960241 for ; Thu, 22 Apr 2021 15:55:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A25E960241 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 17D3D6B0070; Thu, 22 Apr 2021 11:55:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 106F66B0071; Thu, 22 Apr 2021 11:55:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE9336B0072; Thu, 22 Apr 2021 11:55:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id CC2846B0070 for ; Thu, 22 Apr 2021 11:55:34 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 82E341808BB26 for ; Thu, 22 Apr 2021 15:55:34 +0000 (UTC) X-FDA: 78060452988.32.56D6E22 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf22.hostedemail.com (Postfix) with ESMTP id 5D68AC0007D2 for ; Thu, 22 Apr 2021 15:55:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8607AB077; Thu, 22 Apr 2021 15:55:32 +0000 (UTC) Subject: Re: (in)consistency of page/folio function naming To: David Hildenbrand , Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org References: <20210422032051.GM3596236@casper.infradead.org> From: Vlastimil Babka Message-ID: <4fd02ffb-7433-b482-bb1b-81aa3ef1a7e8@suse.cz> Date: Thu, 22 Apr 2021 17:55:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Stat-Signature: gfm6i1zs75kjohs13uz96795sp3cw3rs X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5D68AC0007D2 Received-SPF: none (suse.cz>: No applicable sender policy available) receiver=imf22; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1619106928-359572 Content-Transfer-Encoding: quoted-printable 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 4/22/21 11:09 AM, David Hildenbrand wrote: > On 22.04.21 05:20, Matthew Wilcox wrote: >> >> I'm going through my patch queue implementing peterz's request to rena= me >> FolioUptodate() as folio_uptodate().=C2=A0 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().=C2=A0 The fol= io >> conversion is a great opportunity to sort that out.=C2=A0 Mostly so fa= r, I've >> just done s/page/folio/ on function names, but there's the opportunity= to >> regularise a lot of them, eg: >> >> =C2=A0=C2=A0=C2=A0=C2=A0put_page=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 folio_put >> =C2=A0=C2=A0=C2=A0=C2=A0lock_page=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 folio_lock >> =C2=A0=C2=A0=C2=A0=C2=A0lock_page_or_retry=C2=A0=C2=A0=C2=A0 folio_loc= k_or_retry >> =C2=A0=C2=A0=C2=A0=C2=A0rotate_reclaimable_page=C2=A0=C2=A0=C2=A0 foli= o_rotate_reclaimable >> =C2=A0=C2=A0=C2=A0=C2=A0end_page_writeback=C2=A0=C2=A0=C2=A0 folio_end= _writeback >> =C2=A0=C2=A0=C2=A0=C2=A0clear_page_dirty_for_io=C2=A0=C2=A0=C2=A0 foli= o_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 regu= lar. >> I'm not entirely convinced about folio_lock(), but folio_lock_or_retry= () >> makes more sense than lock_page_or_retry().=C2=A0 Ditto _killable() or >> _async(). >> >> Thoughts? >=20 > I tend to like prefixes: they directly set the topic. Agreed. > The only thing I'm concerned is that we end up with >=20 > put_page vs. folio_put >=20 > which is suboptimal. If we start differing from page's CamelCase, then we can start differing = in this as well. Should be fine if the long-term goal is to convert as much from = pages to folios as possible. Perhaps the remaining page usages could then be co= nverted too for consistency as there won't be many left?