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 AC527C48BE5 for ; Wed, 16 Jun 2021 16:28:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EB24061245 for ; Wed, 16 Jun 2021 16:28:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB24061245 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 623346B0036; Wed, 16 Jun 2021 12:28:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F7F16B006E; Wed, 16 Jun 2021 12:28:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C0356B0070; Wed, 16 Jun 2021 12:28:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id 1DCF36B0036 for ; Wed, 16 Jun 2021 12:28:54 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B9F92160DD for ; Wed, 16 Jun 2021 16:28:53 +0000 (UTC) X-FDA: 78260120946.36.F673412 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 8AFE24202A19 for ; Wed, 16 Jun 2021 16:28:47 +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=P3JM1PR0r8cXkfSpx6oDkANGnRG4SyX1FnBVo8rM8bQ=; b=WkFNMopVIoCUpd6Eqyc/x/e9Cu fGtqjaLTAEaCv2+fGvmJ32Ts/jZ6r7PNwy7GQ4bcxXftK/u5wA58Bp8O3GGvlP486CgGGqCVzvKil f6NddKUR6v9gBJQV08yhXncKu5HVKMVD7nPbvBWLIqf8HA6eIYqkxj4lPUj/BS8a+2RrutyU8n3nR nhFvHOAThn91QcZ52r/220tjI/wqBZtVdMWe+MFXuwTjqbrKT3lIYngmIUaesvNMKTnNClD0c8Rp6 Mq6i8EkL8Cz/L8lkH6Lqh9fX75kiW0FVCnwvy0uj4JgE5foyBq5U6In9bRlhoqkVqCjlq1/qrqsIk 8E3gKO5g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltYOk-008Fhq-En; Wed, 16 Jun 2021 16:28:19 +0000 Date: Wed, 16 Jun 2021 17:28:14 +0100 From: Matthew Wilcox To: Greg Kroah-Hartman Cc: Christoph Hellwig , Andrew Morton , Jan Kara , Al Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] iomap: Use __set_page_dirty_nobuffers Message-ID: References: <20210615162342.1669332-1-willy@infradead.org> <20210615162342.1669332-4-willy@infradead.org> <20210615173453.GA2849@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=WkFNMopV; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8AFE24202A19 X-Stat-Signature: ayczug48x5w5ey9qcmdrmqeq54ttu8tt X-HE-Tag: 1623860927-426253 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 Wed, Jun 16, 2021 at 08:50:40AM +0200, Greg Kroah-Hartman wrote: > On Tue, Jun 15, 2021 at 07:13:16PM +0100, Matthew Wilcox wrote: > > On Tue, Jun 15, 2021 at 07:34:53PM +0200, Christoph Hellwig wrote: > > > Eventually everything around set_page_dirty should be changed to operate > > > on folios, and that will be a good time to come up with a sane > > > naming scheme without introducing extra churn. > > > > The way it currently looks in my tree ... > > > > set_page_dirty(page) is a thin wrapper that calls folio_mark_dirty(folio). > > folio_mark_dirty() calls a_ops->dirty_folio(mapping, folio) (which > > returns bool). > > __set_page_dirty_nobuffers() becomes filemap_dirty_folio() > > __set_page_dirty_buffers() becomes block_dirty_folio() > > __set_page_dirty_no_writeback() becomes dirty_folio_no_writeback() > > > > Now I look at it, maybe that last should be nowb_dirty_folio(). > > Not to be a pain, but you are mixing "folio" at the front and back of > the api name? We messed up in the driver core with this for some things > (get_device() being one), I would recommend just sticking with one > naming scheme now as you are getting to pick what you want to use. That is mostly what I'm doing. eg, get_page -> folio_get lock_page -> folio_lock PageUptodate -> folio_uptodate set_page_dirty -> folio_mark_dirty What I haven't dealt with yet is the naming of the address_space_operations. My thinking with those is that they should be verb_folio, since they _aren't_ the functions that get called. ie it looks like this: folio_mark_dirty() aops->dirty_folio() ext4_dirty_folio() buffer_dirty_folio() I actually see the inconsistency here as a good thing -- these are implementations of the aop, so foo_verb_folio() means you're doing something weird and internal instead of going through the vfs/mm. That implies doing things like renaming ->readpage to ->read_folio, but if we're changing the API from passing a struct page to a struct folio, that can all be done at the same time with no additional disruption.