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 C4580C4332F for ; Tue, 15 Nov 2022 00:41:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EBF566B0071; Mon, 14 Nov 2022 19:41:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E6E4D6B0072; Mon, 14 Nov 2022 19:41:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D37466B0073; Mon, 14 Nov 2022 19:41:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C408F6B0071 for ; Mon, 14 Nov 2022 19:41:14 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 98628140FC8 for ; Tue, 15 Nov 2022 00:41:14 +0000 (UTC) X-FDA: 80133822468.20.A25CE5B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 631E940006 for ; Tue, 15 Nov 2022 00:41:12 +0000 (UTC) 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668472872; a=rsa-sha256; cv=none; b=WWK96yB6nlFnJp3so5tvBxS3TVCrMAiLZqSJ1XysBW4fqUxtW5EttiZjYLhAskrtoQe3RM SOFGxSTUlW448/+3izAHjL60zbQjqz7esc4LZbtf5rWvcqTyU+x/lJoj/ldOLLtJCtA455 ybpCueaeY6CHc6t+XtEq0KhoUm56Ch8= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eh7bihop; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf01.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668472872; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kjYfp2hW5B/t44pYPHObfllFdrU8NC2GUrC2Ho+QsFY=; b=dYgUNssBKfh+LOvAGXLypMn13L4+hPSKZ59KPcwnWs7S8B+mRSKG6brpTiLS4V/LMu4EuH oPQdy/ZVK1CAsNssk5h3IQ048sUb+oJSbVJpAaiuFb+gDYWJvGwNB9MbrszSoeLkMjj/Ck BXeAAJBG3a3FhoMGsGEGwZuwy1ZgJkw= X-Rspamd-Queue-Id: 631E940006 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eh7bihop; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf01.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: e815c4z74mah7e65j79f6mw95jausq59 X-HE-Tag: 1668472872-34957 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: 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