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 25C28C433ED for ; Sat, 1 May 2021 14:31:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 962306157E for ; Sat, 1 May 2021 14:31:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 962306157E 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 B207D6B006C; Sat, 1 May 2021 10:31:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD0386B006E; Sat, 1 May 2021 10:31:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 970CB6B0070; Sat, 1 May 2021 10:31:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 782A16B006C for ; Sat, 1 May 2021 10:31:21 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 30E4F3658 for ; Sat, 1 May 2021 14:31:21 +0000 (UTC) X-FDA: 78092899962.05.91FF3D8 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id 5C529407F8EB for ; Sat, 1 May 2021 14:31:10 +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=xDmBUI6hsWPgWcBw60PznzQUmAxS2/iaYf0yquB+Hew=; b=slUcHygL38UmDpEXWUfGqoh0v4 O0u/QlQhk+SxhhU2JNvuhPWOzfm2ubkOwoKcIsCW/3iJlqWNRbYsGJCx1FEVzuAB3sDR9uNjByVbP /P44k0HciHIstfyUy/NzclobuIw4vDNKvIP+dXU4Rk1DQIgKs6qZDyYpuzTGkhiI1skgrf8BTlW67 P5dDFS0tESSTdatWbS8w/VCvA0ExoG3Z9eSCCBCgxJQHXf7rilj1zLFyQJUs4BQin3CL07w2YQfAI jBT9ovRKfJopYByN/EEvreGP3+BwqsszsUb4Vb9Y73POYG1EhZULS+B/Q30WnPdoO1UyKSuk7N+T+ V0iHY8Wg==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lcqe8-00CTP8-IA; Sat, 01 May 2021 14:31:07 +0000 Date: Sat, 1 May 2021 15:31:04 +0100 From: Matthew Wilcox To: Nicholas Piggin Cc: 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: <20210501143104.GR1847222@casper.infradead.org> References: <20210430180740.2707166-1-willy@infradead.org> <1619832406.8taoh84cay.astroid@bobo.none> <20210501023711.GP1847222@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210501023711.GP1847222@casper.infradead.org> Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=slUcHygL; dmarc=none; spf=none (imf26.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: rspam01 X-Rspamd-Queue-Id: 5C529407F8EB X-Stat-Signature: cupirwuto5d4ejijs8iyxe555xztsmwr Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619879470-24279 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 03:37:11AM +0100, Matthew Wilcox wrote: > On Sat, May 01, 2021 at 11:32:20AM +1000, Nicholas Piggin wrote: > > Excerpts from Hugh Dickins's message of May 1, 2021 4:47 am: > > > On Fri, 30 Apr 2021, Matthew Wilcox (Oracle) 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). > > > > We have a set_page_dirty(), so page_set_dirty() would be annoying. > > page_flag_set_dirty() keeps the easy distinction that SetPageDirty() > > provides. > > Maybe I should have sent more of the patches in this batch ... > > mark_page_accessed() becomes folio_mark_accessed() > set_page_dirty() becomes folio_mark_dirty() > set_page_writeback() becomes folio_start_writeback() > test_clear_page_writeback() becomes __folio_end_writeback() > cancel_dirty_page() becomes folio_cancel_dirty() > clear_page_dirty_for_io() becomes folio_clear_dirty_for_io() > lru_cache_add() becomes folio_add_lru() > add_to_page_cache_lru() becomes folio_add_to_page_cache() > write_one_page() becomes folio_write_one() > account_page_redirty() becomes folio_account_redirty() > account_page_cleaned() becomes folio_account_cleaned() > > So the general pattern is that folio_set_foo() and folio_clear_foo() > works on the flag directly. If we do anything fancy to it, it's > folio_verb_foo() where verb depends on foo. After sleeping on this, I now think "Why not both?" folio_dirty() -- defined in page-flags.h 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 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 the other flags would mostly follow this pattern. i'd also change folio_set_uptodate() to folio_mark_uptodate().