Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6241475rwb; Mon, 14 Nov 2022 17:01:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf7x+HuMwEnPNX3sXDZqQVKL9HhbujPC49nLjWL4Dw5vG/MOLKTfEy2c3e/ORKt6mHrvgsTA X-Received: by 2002:a63:6742:0:b0:46f:59af:c1f4 with SMTP id b63-20020a636742000000b0046f59afc1f4mr13199506pgc.344.1668474092385; Mon, 14 Nov 2022 17:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668474092; cv=none; d=google.com; s=arc-20160816; b=T/Ns3QzhtcsofQwO2CVjWcXkEf6YPO4STF30kya5B/EP8lNLQsl25jqcSQeKi8LYnd mur/ZwTzIe5Nv3txNy/TqDGlHS7PYZAHnJqgRnoxg49mD6ok0sVnR2CLRhMi1kzkmDLH mOlYjjWgRDbiN2lVD7g8fXAYxB4XQi5ffyJZGFUarIabnEa7rCRF/UPRzi0kZIPEeXwO WLEY/8vJninmNihHm199g3A2cRYi3KSlF3GsD9eq/yYxvs9V91hr/GyB6kHGPsEDVfAN GqxvefNMQi9JW1ptdTchdz5oewXECa0MC7IOTwiPusk7FDpr4pSutKa463+QedbbUAU3 wzIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=kjYfp2hW5B/t44pYPHObfllFdrU8NC2GUrC2Ho+QsFY=; b=NTBKSL4qW3nUrzg6BwFpmry0l3usCkVSUKMEfOPkmPQusf8tZ2zsUcscIzbaGn9sZO yRfMCN9VeQcY/Tn9Sq1DTeuizsW28Is0gU40wZyNYiExaxDV3dCblpW2n+5ntaKAa3r2 3sS59e73uRUKM2+gHm1raqOSJSkge8dKVn8R6wGg5pCyulAjzfsHWWuaMt619KW1b3lD TFIUJhZu6JA1ZD76+9Uq2101HqWaw8WuE6ePvOqzxVioBfx/Rgru1sxPxGg3PqLKy/v1 KarjT0OIUjQoYrkcQlpB2aNzjX6Ll/SmOQKlTPnWUeTL5bkmMeA8vmDUh/GvrJ9hrglR LdCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eh7bihop; 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 r5-20020a170902e3c500b0017eae5cc961si9573423ple.306.2022.11.14.17.01.08; Mon, 14 Nov 2022 17:01:32 -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=eh7bihop; 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 S236456AbiKOAmH (ORCPT + 99 others); Mon, 14 Nov 2022 19:42:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235954AbiKOAmG (ORCPT ); Mon, 14 Nov 2022 19:42:06 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56A961AD95 for ; Mon, 14 Nov 2022 16:41:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668472871; 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: in-reply-to:in-reply-to:references:references; bh=kjYfp2hW5B/t44pYPHObfllFdrU8NC2GUrC2Ho+QsFY=; b=eh7bihopSjCNIX/RQTaEoXB9zbLbaRvgm8vj3Wj+CswdxLvAE83rWMjfj+09nG71xc/VmY 0NDGAmzfXh7dKjqBi10rVF7VynWxcMFT5Y6eHpWVNVO8osjEVYanNqTKNDl74QpfqZQaou +LRvfNT63d/bVehoeGc7KmVHfWXtU40= 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-177-1FDKG86uNcGiCRr5tfa-9Q-1; Mon, 14 Nov 2022 19:41:08 -0500 X-MC-Unique: 1FDKG86uNcGiCRr5tfa-9Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 791EC3814587; Tue, 15 Nov 2022 00:41:07 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75D27400DFD4; Tue, 15 Nov 2022 00:41:05 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <166844174069.1124521.10890506360974169994.stgit@warthog.procyon.org.uk> To: Dominique Martinet Cc: dhowells@redhat.com, willy@infradead.org, dwysocha@redhat.com, Rohith Surabattula , Steve French , Shyam Prasad N , Ilya Dryomov , linux-cachefs@redhat.com, linux-cifs@vger.kernel.org, linux-afs@lists.infradead.org, v9fs-developer@lists.sourceforge.net, ceph-devel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2] mm, netfs, fscache: Stop read optimisation when folio removed from pagecache MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1457984.1668472862.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Tue, 15 Nov 2022 00:41:02 +0000 Message-ID: <1457985.1668472862@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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 Dominique Martinet wrote: > any harm in setting this if netfs isn't enabled? > (just asking because you checked in fs/9p/cache.c above) Well, it forces a call to ->release_folio() every time a folio is released= , if set, rather than just if PG_private/PG_private_2 is set. > > +static inline void mapping_clear_release_always(struct address_space = *mapping) > > +{ > > + set_bit(AS_RELEASE_ALWAYS, &mapping->flags); > = > clear_bit certainly? Bah. Yes. > > - if (folio_has_private(folio) && !filemap_release_folio(folio, 0)) > > + if (!filemap_release_folio(folio, 0)) > = > should this (and all others) check for folio_needs_release instead of ha= s_private? > filemap_release_folio doesn't check as far as I can see, but perhaps > it's already fast and noop for another reason I didn't see. Willy suggested merging the checks from folio_has_private() into filemap_release_folio(): https://lore.kernel.org/r/Yk9V/03wgdYi65Lb@casper.infradead.org/ David