From patchwork Thu Dec 22 15:01:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13080075 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43388C41535 for ; Thu, 22 Dec 2022 15:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235300AbiLVPCv (ORCPT ); Thu, 22 Dec 2022 10:02:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235534AbiLVPCt (ORCPT ); Thu, 22 Dec 2022 10:02:49 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4062821276 for ; Thu, 22 Dec 2022 07:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671721322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LJ9TKjkNcbwIl+mphZW6iF9b6MFhoECdv27WBprwBlw=; b=M3IqyvZS3yKdWhlO6ebxH0gqP68j7MYUxxykryNVppYvhqVR7uy/m2Pw0Gwk5G2k3SUgtq hPpN558NrjHRhcqvMmHuligeXbrZlJLR2YYcz1hChNX5V07J68e5Lbng6DTlMkxdhf09Nc CDujoVszFRsDGbP1PYxtDhL895K2qYY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-546-vEDcC2HANCu8HRye7N1l7Q-1; Thu, 22 Dec 2022 10:01:59 -0500 X-MC-Unique: vEDcC2HANCu8HRye7N1l7Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8C0CF1C06901; Thu, 22 Dec 2022 15:01:57 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id 844512166B29; Thu, 22 Dec 2022 15:01:54 +0000 (UTC) Subject: [PATCH v5 0/3] mm, netfs, fscache: Stop read optimisation when folio removed from pagecache From: David Howells To: Matthew Wilcox Cc: Linus Torvalds , linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, Steve French , Shyam Prasad N , Dave Wysochanski , Dominique Martinet , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, Rohith Surabattula , linux-cachefs@redhat.com, Andreas Dilger , linux-nfs@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-mm@kvack.org, Theodore Ts'o , Ilya Dryomov , linux-cifs@vger.kernel.org, dhowells@redhat.com, Linus Torvalds , Jeff Layton , linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-erofs@lists.ozlabs.org, linux-ext4@lists.ozlabs.org, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 22 Dec 2022 15:01:53 +0000 Message-ID: <167172131368.2334525.8569808925687731937.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.5 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Hi Linus, I've split the folio_has_private()/filemap_release_folio() call pair merging into its own patch, separate from the actual bugfix and pulled out the folio_needs_release() function into mm/internal.h and made filemap_release_folio() use it. I've also got rid of the bit clearances from the network filesystem evict_inode functions as they doesn't seem to be necessary. Note that the last vestiges of try_to_release_page() got swept away in the current merge window, so I rebased and dealt with that. One comment remained, which is removed by the first patch. David Changes: ======== ver #5) - Rebased on linus/master. try_to_release_page() has now been entirely replaced by filemap_release_folio(), barring one comment. - Cleaned up some pairs in ext4. ver #4) - Split has_private/release call pairs into own patch. - Moved folio_needs_release() to mm/internal.h and removed open-coded version from filemap_release_folio(). - Don't need to clear AS_RELEASE_ALWAYS in ->evict_inode(). - Added experimental patch to reduce shrink_folio_list(). ver #3) - Fixed mapping_clear_release_always() to use clear_bit() not set_bit(). - Moved a '&&' to the correct line. ver #2) - Rewrote entirely according to Willy's suggestion[1]. Link: https://lore.kernel.org/r/Yk9V/03wgdYi65Lb@casper.infradead.org/ [1] Link: https://lore.kernel.org/r/164928630577.457102.8519251179327601178.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/166844174069.1124521.10890506360974169994.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/166869495238.3720468.4878151409085146764.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/1459152.1669208550@warthog.procyon.org.uk/ # v3 also --- David Howells (3): mm: Merge folio_has_private()/filemap_release_folio() call pairs mm, netfs, fscache: Stop read optimisation when folio removed from pagecache mm: Make filemap_release_folio() better inform shrink_folio_list() fs/9p/cache.c | 2 ++ fs/afs/internal.h | 2 ++ fs/cachefiles/namei.c | 2 ++ fs/ceph/cache.c | 2 ++ fs/cifs/fscache.c | 2 ++ fs/ext4/move_extent.c | 12 ++++-------- fs/splice.c | 3 +-- include/linux/pagemap.h | 23 ++++++++++++++++++++++- mm/filemap.c | 20 +++++++++++++++----- mm/huge_memory.c | 3 +-- mm/internal.h | 11 +++++++++++ mm/khugepaged.c | 3 +-- mm/memory-failure.c | 8 +++----- mm/migrate.c | 3 +-- mm/truncate.c | 6 ++---- mm/vmscan.c | 35 ++++++++++++++++++----------------- 16 files changed, 89 insertions(+), 48 deletions(-)