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.5 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 6C683C433B4 for ; Sun, 2 May 2021 00:17:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E271461454 for ; Sun, 2 May 2021 00:17:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E271461454 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 382AE6B006C; Sat, 1 May 2021 20:17:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E4166B006E; Sat, 1 May 2021 20:17:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 137766B0070; Sat, 1 May 2021 20:17:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id E6A586B006C for ; Sat, 1 May 2021 20:17:31 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A04B32C14 for ; Sun, 2 May 2021 00:17:31 +0000 (UTC) X-FDA: 78094377102.32.987FCE1 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf24.hostedemail.com (Postfix) with ESMTP id 064C3A0003B8 for ; Sun, 2 May 2021 00:17:18 +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=AJqYP9E0uYAvEBKxSQheh1x0I1D7jTFKZhx2V8wDkK4=; b=O2UZykb+fFkx3GRnUwTN4oiE6D whn0L7HqvQiPXrLOFiIt/gz7pnmLYNhCNjlqJ/XyST/stv1RPAk5ul7cU0lUE7i0mZInH/NLX2Klc xoWTue+Ylzs2kKUpSHSu4cJNOHpALWGW7KkXDmf1T0uXQCaBWKXH9xr5USFc7Q48yHDhBZ8W3S055 7O1+q9U8hxrSBK0J/7uEJxhgzgLDr1PK72SclqB6W43pv+Nm1DJPhsKf7rcbpFZi3Ltri7axDSY2i Bmy+ISQCXO+LIyDqFAj5GnP/tmqcvd3NErduompNJIybIZOBEDTB1XY7JH9f/XkhlRSN2a8Iv9bnK Xi0BKdFg==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lcznF-00D3kB-Ab; Sun, 02 May 2021 00:17:07 +0000 Date: Sun, 2 May 2021 01:17:05 +0100 From: Matthew Wilcox To: John Hubbard Cc: Nicholas Piggin , Hugh Dickins , akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds Subject: Re: [PATCH v8.1 00/31] Memory Folios Message-ID: <20210502001705.GW1847222@casper.infradead.org> References: <20210430180740.2707166-1-willy@infradead.org> <1619832406.8taoh84cay.astroid@bobo.none> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=O2UZykb+; dmarc=none; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 064C3A0003B8 X-Stat-Signature: i6wyj96rhh17x9fpti4fidsiwscn4xby Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619914638-768890 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 Sat, May 01, 2021 at 02:38:50PM -0700, John Hubbard wrote: > On 4/30/21 6:32 PM, Nicholas Piggin wrote: > ... > > > > - Big renaming (thanks to peterz): > > > > - PageFoo() becomes folio_foo() > > > > - SetFolioFoo() becomes folio_set_foo() > > > > - ClearFolioFoo() becomes folio_clear_foo() > > > > - __SetFolioFoo() becomes __folio_set_foo() > > > > - __ClearFolioFoo() becomes __folio_clear_foo() > > > > - TestSetPageFoo() becomes folio_test_set_foo() > > > > - TestClearPageFoo() becomes folio_test_clear_foo() > > > > - PageHuge() is now folio_hugetlb() > > > > If you rename these things at the same time, can you make it clear > > they're flags (folio_flag_set_foo())? The weird camel case accessors at > > least make that clear (after you get to know them). > > In addition to pointing out that the name was a page flag, the weird > camel case also meant, "if you try to search for this symbol, you will > be defeated", because the darn thing is constructed via macro > concatenation. I've always hated that, FWIW. And you can't add kernel-doc for them because kernel-doc doesn't understand cpp. So my current plan (quoting my other email): folio_dirty() -- defined in page-flags.h would have kernel-doc, would be greppable folio_test_set_dirty_flag() folio_test_clear_dirty_flag() __folio_clear_dirty_flag() __folio_set_dirty_flag() folio_clear_dirty_flag() folio_set_dirty_flag() -- generated in filemap.h under #ifndef MODULE would not have kernel-doc, would not be greppable, would only be used in core vfs and core mm. folio_mark_dirty() -- declared in mm.h (this is rare; turns out all kinds of crap wants to mark pages as being dirty) folio_clear_dirty_for_io() -- declared in filemap.h already have kernel-doc, are greppable, used by filesystems and sometimes other random code. > Except that over time, it turned out to be not quite that simple, and > people started adding functionality. So now it's "cannot find it, and > it's also got little goodies hiding in there--maybe!". I also don't like that. With what I'm thinking, there are no special cases hidden in the autogenerated names. Special things like the current SetPageUptodate would be in folio_mark_uptodate() and filesystems couldn't even call folio_set_uptodate(). > Given all that, I'd argue for either: > b) changing a bunch of the items to actual written-out names. What's > the harm? We'd end up with a longer file, but one could grep or > cscope for the names. I hope the above makes you happy -- everything a filesystem author needs gets kernel-doc. People working inside the VM/VFS still get exposed to undocumented folio_test_set_foo_flag(), but it's all regular and autogenerated.