Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp229945rwj; Thu, 22 Dec 2022 07:06:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXufFuKrD13PIyLhRSsB//VR72Dup1LinB0afpssF2NHtSZ1qWyVmw2VqRFxW/wFgM73MaJm X-Received: by 2002:aa7:c64e:0:b0:467:4df0:7185 with SMTP id z14-20020aa7c64e000000b004674df07185mr8479584edr.4.1671721599644; Thu, 22 Dec 2022 07:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671721599; cv=none; d=google.com; s=arc-20160816; b=FSse0N6G727pDE1wB8W4FGCjRFg4AsNF8DF98xjsOA4qAuPePR/QcXKE8jzGDORk+s M9nduNpldwdSDjcvpD2XW7vlAV34jO/k1h7iFohxSEsybLRURL1uQQa/hLg8Rt3Onw7s 5SS+t1h0hscqtZZcFymHADZ9rjYgg4Suf0802/DbIfXg5WhR5K7nlFx8nk42LJJFxNHW 0FG24Bhf8OCa4lPeNCLykTk67n2VDR10RkyjsIhRc3LctvDtvsDQqOEfy8J5NyWXGlwu wCd6Zipoj0bKRda5Z/CpiswK94cl5OnLZDsX9VURo+Px/VqUYoDoF+XD8zI0KZbGsI3W cFVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=LJ9TKjkNcbwIl+mphZW6iF9b6MFhoECdv27WBprwBlw=; b=X71lUIWdUa0sCcTcteswwpO/laAU7liD6hez/HCBdeZapnAm8kSHwWlxmRh/XeUVPd oADh5BjfAflhrOFj76LiUefo+RE4mCk6Y0YZT0gk7YxFMpqkk7ndo6wMm8x2jU8kVgCW v5icfifBvnYTm57Tuz7CCe6GKNfLXYL7IRvkHlIfbXGA0tZK2bkd9XxLEER2EwjcGWu9 cGzBaBBk14erTr1uSSMK6LBGd/Y/io3wxZI1Dgy4Lp/n3sIhwB77+OA+IAH7d1wdLNDd +cg+tS9E631Dyp/hvh846JHIACe+SEtUufnkv2FalK64w/MzjIPzieINEcS85xAT8H/i 2ZgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M3IqyvZS; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a1709064fc400b0078772382b35si687511ejw.91.2022.12.22.07.06.14; Thu, 22 Dec 2022 07:06:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M3IqyvZS; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235524AbiLVPCu (ORCPT + 99 others); Thu, 22 Dec 2022 10:02:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235300AbiLVPCt (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 39A698FC9 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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(-)