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 F1FA3C433B4 for ; Tue, 6 Apr 2021 16:26:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 67806613CC for ; Tue, 6 Apr 2021 16:26:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67806613CC 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 A97A36B0073; Tue, 6 Apr 2021 12:26:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A470D6B0080; Tue, 6 Apr 2021 12:26:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E80A6B0081; Tue, 6 Apr 2021 12:26:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 6D35E6B0073 for ; Tue, 6 Apr 2021 12:26:19 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2331B365C for ; Tue, 6 Apr 2021 16:26:19 +0000 (UTC) X-FDA: 78002469678.06.D9216A2 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id 0BF8F80192F1 for ; Tue, 6 Apr 2021 16:26:11 +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=ReC1A8LEcNA74MnXWjE1S8Le2jL7zE3sYBVCRscMRCs=; b=fx834GXHLWrbKbI/6uLgpgctFM Q5KyQ0MFtvxJh6NlhE3d0eXK6x3CQugCROk+IFxmFqPLGA2qPvseVy/ls2tuS7hPms11iObLBCauI OV7uHRQf7Ib9zGKIXKGbsYFT6Ra8bxC+RnIadJehDso2FLs/+cWo6UZ9vbgFuu/m62nepdJ2+qqM3 hWDUhYWehUlmEjiVsKsv0dKjn/3ibDjp1xFxH4zc3PQRHwRvr5J/AJqdmwa4RcUfllWWy/ilBGw4s shHJ58BfrKh2KiEek2rfcG+9LJdKhTVSQASLZo5bcWwqYFXTXwm9vvMRLjbkaogq15yeyrkIABQ1/ E/r4rZwA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lToWA-00D5BK-1j; Tue, 06 Apr 2021 16:25:40 +0000 Date: Tue, 6 Apr 2021 17:25:30 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: "Kirill A. Shutemov" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, linux-afs@lists.infradead.org Subject: Re: [PATCH v6 01/27] mm: Introduce struct folio Message-ID: <20210406162530.GT2531743@casper.infradead.org> References: <20210331184728.1188084-1-willy@infradead.org> <20210331184728.1188084-2-willy@infradead.org> <20210406122918.h5dsnbjhmwpfasf4@box.shutemov.name> <20210406124807.GO2531743@casper.infradead.org> <20210406143150.GA3082513@infradead.org> <20210406144022.GR2531743@casper.infradead.org> <20210406144712.GA3087660@infradead.org> <20210406145511.GS2531743@casper.infradead.org> <20210406150550.GA3094215@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210406150550.GA3094215@infradead.org> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0BF8F80192F1 X-Stat-Signature: 5rkyd9rjqei9zs3j83by5fj1ztgaa89o Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617726371-950313 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 Tue, Apr 06, 2021 at 04:05:50PM +0100, Christoph Hellwig wrote: > On Tue, Apr 06, 2021 at 03:55:11PM +0100, Matthew Wilcox wrote: > > Assuming we're getting rid of them all though, we have to include: > > > > $ git grep 'page->mapping' fs |wc -l > > 358 > > $ git grep 'page->index' fs |wc -l > > 355 > > Are they all going to stay? Or are we going to clean up some of that > mess. A lot of ->index should be page_offet, and on the mapping side > the page_mapping and page_file_mapping mess is also waiting to be > sorted.. About a third of ->index can be folio_offset(), based on a crude: $ git grep 'page->index.*PAGE_' |wc -l 101 and I absolutely don't mind cleaning that up as part of the folio work, but that still leaves 200-250 instances that would need to be changed later. I don't want to change the page->mapping to calls to folio_mapping(). That's a lot of extra work for a page which the filesystem knows belongs to it. folio_mapping() only needs to be used for pages which might not belong to a filesystem. page_file_mapping() absolutely needs to go away. The way to do that is to change swap-over-nfs to use direct IO, and then NFS can use folio->mapping like all other filesystems. f2fs is just terminally confused and shouldn't be using page_file_mapping at all. I'll fix that as part of the folio work.