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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5659DC433F5 for ; Mon, 14 Feb 2022 20:00:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 18A496B0085; Mon, 14 Feb 2022 15:00:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0EBA96B0087; Mon, 14 Feb 2022 15:00:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA6A16B0089; Mon, 14 Feb 2022 15:00:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id D35EF6B0085 for ; Mon, 14 Feb 2022 15:00:24 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 94ECA82C609E for ; Mon, 14 Feb 2022 20:00:24 +0000 (UTC) X-FDA: 79142452368.16.881F3CC Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf27.hostedemail.com (Postfix) with ESMTP id 1780D40018 for ; Mon, 14 Feb 2022 20:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=/rveRtCAVtTxS7QANg2AkZ7UaZV55OMKQy2uRCLWACE=; b=Ldh5T3N6zurDGcPZAcsvYHoW0k ZWWwFmsBr4iLkOxqgETxhe2SfLp7aVqkGuF1KyvddCoj/SJRy4eamVgzMH4BaGPiGYI2uOqJay3nv L3DVCWEKDTQelw9McfH995jGX/ZywY3MYqrQN0IUHz1bQ1NSQL5z7BpKyNx08ZnpotDnoeNSEncEs jav2MecNNr2ez09MXh4pGmRWdlAqUav1AEIDJBy5TS7UQ5NQtZcgeNyvp9eKYsrIVk/jyJMvdtkch 98dAZO6eiyKnfzzKBdHHMPRjix0j8eOfEZPcsgMP4UG4/OofHJ1s9QzNvAOzftKGmnyKsPsDNGO8A wdlBlz7A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJhWF-00DDdS-5f; Mon, 14 Feb 2022 20:00:19 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 00/10] Various fixes around invalidate_page() Date: Mon, 14 Feb 2022 20:00:07 +0000 Message-Id: <20220214200017.3150590-1-willy@infradead.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1780D40018 X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Ldh5T3N6; spf=none (imf27.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-Stat-Signature: os8cdn9upfggrgn4dmji5suqz63x4xrn X-HE-Tag: 1644868823-133212 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: Blame Rik for this. His "clean up hwpoison page cache page in fault path= " patch on Friday made me look at how invalidate_inode_page() handled tail pages. It's not buggy, but __invalidate_mapping_pages() has a minor accounting bug, and all of this related code could be done a little more efficiently by using folios instead of pages. I don't _love_ the name mapping_shrink_folio(), but I'm having a hard time coming up with a verb that means "remove from cache if unused". Maybe mapping_evict_folio()? Or filemap_evict_folio()? The last two patches are just cleanup that should be done at some point, and since this patchset already conflicts with everything else, why not? I've stashed these in my for-next tree immediately after converting __remove_mapping() to take a folio because it seems to fit best there. The bots may complain about build problems as a result, but this is really a patch series for humans to review. Matthew Wilcox (Oracle) (10): splice: Use a folio in page_cache_pipe_buf_try_steal() mm/truncate: Inline invalidate_complete_page() into its one caller mm/truncate: Convert invalidate_inode_page() to use a folio mm/truncate: Replace page_mapped() call in invalidate_inode_page() mm: Convert remove_mapping() to take a folio mm/truncate: Split invalidate_inode_page() into mapping_shrink_folio() mm/truncate: Convert __invalidate_mapping_pages() to use a folio mm: Turn deactivate_file_page() into deactivate_file_folio() mm/truncate: Combine invalidate_mapping_pagevec() and __invalidate_mapping_pages() fs: Move many prototypes to pagemap.h drivers/block/xen-blkback/xenbus.c | 1 + drivers/usb/gadget/function/f_mass_storage.c | 1 + fs/coda/file.c | 1 + fs/iomap/fiemap.c | 1 + fs/nfsd/filecache.c | 1 + fs/nfsd/vfs.c | 1 + fs/splice.c | 24 ++-- fs/vboxsf/utils.c | 1 + include/linux/fs.h | 120 ------------------- include/linux/mm.h | 1 - include/linux/pagemap.h | 114 ++++++++++++++++++ include/linux/swap.h | 3 +- mm/internal.h | 4 + mm/memory-failure.c | 4 +- mm/swap.c | 33 +++-- mm/truncate.c | 109 ++++++++--------- mm/vmscan.c | 23 ++-- 17 files changed, 219 insertions(+), 223 deletions(-) --=20 2.34.1