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 37EFDECAAD2 for ; Fri, 2 Sep 2022 00:30:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 81DD78D0003; Thu, 1 Sep 2022 20:30:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CCA48D0001; Thu, 1 Sep 2022 20:30:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66D198D0003; Thu, 1 Sep 2022 20:30:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 540F78D0001 for ; Thu, 1 Sep 2022 20:30:40 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 2C1CE1A0135 for ; Fri, 2 Sep 2022 00:30:40 +0000 (UTC) X-FDA: 79865264640.28.40562C0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 67A211C003B for ; Fri, 2 Sep 2022 00:30:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662078638; 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: in-reply-to:in-reply-to:references:references; bh=rDZu8IIo6FPE/pW88XoO5299clxnp4rO8KLGZtj/WqU=; b=SPnSpBmz3dWRGHk08CSHlBzjJDq7+mtW/d+7qLjJJnwGiidMm6scgqqe/YuddU+CId6PTe vnZVtc+4KIiLzuUXXxlQoz6eD0FiAMT8MlvYSm11WfGJQA5pMi8B4vDvg6cgY8VYW7/QmX p3+dscZ8DYZxxpYhhwgYMNmQNMXHmD0= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-447-6-EI1-7SNRW9ZDT8vVSryQ-1; Thu, 01 Sep 2022 20:30:38 -0400 X-MC-Unique: 6-EI1-7SNRW9ZDT8vVSryQ-1 Received: by mail-il1-f198.google.com with SMTP id l20-20020a056e02067400b002dfa7256498so542418ilt.4 for ; Thu, 01 Sep 2022 17:30:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=rDZu8IIo6FPE/pW88XoO5299clxnp4rO8KLGZtj/WqU=; b=ypLHOaeka9BjdzueQ8twrrwDCgk+M9rkYp/+QDDNvehXnFCVt7LqP0XY7tzXjMNclF WuldA3rv0UAyzditmH/PJc7FP3lkKdresQ8SrvVcGborUYT2Dmm1kic9DQKU8DTzROzY xeSrTfJKbzm4Eexf74g62s5Die/9c8AYCno+cRlqlNFiiT3kRLC5gzcfC5nLeHGIcmos aQ/ncFUpALMgCml6fu1N9iWeB1Hs+ymsBb46R6tf12bHb79tz5lqNyOO7glYePbdKF4o HptVcL4m9WdwGUPFm5ohmsbW3w7oYVRFzMTIc+VKkyd0ALxd8EAu7YvqW0pq3+p699c4 /q9w== X-Gm-Message-State: ACgBeo1dTxwbLOBwgIkfO83AlFiYqAI7n9vuH7WwxV9uVmrfs4+IYTxz VWOmkujopdYxc+soRJ9uYpqI7OqAAeqpcz9vAm82oHnSKYET1nesClJz98ErE95ZwFjMCvOtrzf IpuMHdktLeFTqyhAWgRTusttdnQQ= X-Received: by 2002:a05:6e02:1566:b0:2e5:a1e7:7e15 with SMTP id k6-20020a056e02156600b002e5a1e77e15mr18070504ilu.122.1662078637325; Thu, 01 Sep 2022 17:30:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR6GNEbo0HFrxRlkS8cFvm/4EqoJtG46l3ycAfgK47CcGAB1FjQ4c1MCzUsZ6rBC4gPoPrJawBhcVFjyIgvAjTc= X-Received: by 2002:a05:6e02:1566:b0:2e5:a1e7:7e15 with SMTP id k6-20020a056e02156600b002e5a1e77e15mr18070485ilu.122.1662078637075; Thu, 01 Sep 2022 17:30:37 -0700 (PDT) MIME-Version: 1.0 References: <164928615045.457102.10607899252434268982.stgit@warthog.procyon.org.uk> <164928630577.457102.8519251179327601178.stgit@warthog.procyon.org.uk> <469869.1649313707@warthog.procyon.org.uk> <3118843.1650888461@warthog.procyon.org.uk> In-Reply-To: From: David Wysochanski Date: Thu, 1 Sep 2022 20:30:01 -0400 Message-ID: Subject: Re: [PATCH 14/14] mm, netfs, fscache: Stop read optimisation when folio removed from pagecache To: Matthew Wilcox Cc: David Howells , linux-cachefs , Rohith Surabattula , Steve French , Shyam Prasad N , linux-cifs , Jeff Layton , linux-fsdevel , Linux Kernel Mailing List , linux-mm@kvack.org, Daire Byrne X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662078639; a=rsa-sha256; cv=none; b=N01Lxv+LdoEDZ0e2zwPA2C8V/+OFy8kA7/0AVQSQSsbrtemfCTefMAHUq0vARAK5KjuCu/ 0BAL0/bdPmXwMgliBlK4Q7sQOkW+OBVJuk8kwnROoXT7MsEZFVZoqVNk7Qzdruf6ZFPfNe 6Evu7dkjYp/GaAhbIVo+xwVIUL8cGy4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SPnSpBmz; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of dwysocha@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dwysocha@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662078639; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rDZu8IIo6FPE/pW88XoO5299clxnp4rO8KLGZtj/WqU=; b=qNRqav16YGJXpr68deCDsy9dAodpcCvtbhRs4DGIN+eS6bvG4UHS5fXBTSc0blXdogqcSM QrvC1JbJIbQRAKEs25sx+myQE4VGmHa8T9xpQQu4SCtV8P1PoD/mkWDy0eYBdztAgJepXN z0Czp02LA5gqLgy+s3AIzea1rC0BMtE= X-Stat-Signature: m6p7q7q9yh5pbe5ym87ufmyikngebd1s X-Rspamd-Queue-Id: 67A211C003B X-Rspam-User: Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SPnSpBmz; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of dwysocha@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dwysocha@redhat.com X-Rspamd-Server: rspam08 X-HE-Tag: 1662078639-414026 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 Mon, Apr 25, 2022 at 8:30 AM Matthew Wilcox wrote: > > On Mon, Apr 25, 2022 at 01:07:41PM +0100, David Howells wrote: > > Matthew Wilcox wrote: > > > > > OK. You suggested that releasepage was an acceptable place to call it. > > > How about we have AS_RELEASE_ALL (... or something ...) and then > > > page_has_private() becomes a bit more complicated ... to the point > > > where we should probably get rid of it (by embedding it into > > > filemap_release_folio(): > > > > I'm not sure page_has_private() is quite so easy to get rid of. > > shrink_page_list() and collapse_file(), for example, use it to conditionalise > > a call to try_to_release_page() plus some other bits. > > That's what I was saying. Make the calls to try_to_release_page() > unconditional and delete page_has_private() because it only confuses > people who should actually be using PagePrivate(). > > > I think that, for the moment, I would need to add a check for AS_RELEASE_ALL > > to page_has_private(). > > > > David > > > > > I am not sure what the next steps are here but I wanted to ping about this patch. NFS also needs this patch or something like it. David are you planning to submit an updated series with an updated patch? A partial backport of David's original patch here on top of my v3 NFS netfs conversion patches [1] resolves one of my unit test failures where there were extra reads from the network instead of the cache. Also Daire Byrne indicates that he too was seeing the same thing and he tested my patches below and it resolved his issue as well. Note that I needed another netfs patch in this series, "netfs: Provide invalidatepage and releasepage calls" on top of this one, to resolve the problem. [1] https://github.com/DaveWysochanskiRH/kernel/commits/nfs-fscache-netfs-removing-folio $ git log --oneline | head ad90bddf6570 NFS: Add usage of new VFS API removing folio 9e2a7c301564 mm,netfs: Add removing_folio() to stop netfs read optimization (TEST ONLY) 776088910162 netfs: Provide invalidatepage and releasepage calls 8aa1379ceb49 NFS: Convert buffered read paths to use netfs when fscache is enabled 807808d87040 NFS: Configure support for netfs when NFS fscache is configured 43a41cce491d NFS: Rename readpage_async_filler to nfs_pageio_add_page b90cb1053190 Linux 6.0-rc3