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 847B2C41535 for ; Fri, 22 Dec 2023 11:50:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F5666B0071; Fri, 22 Dec 2023 06:50:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A3DC6B007D; Fri, 22 Dec 2023 06:50:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 092AE6B007E; Fri, 22 Dec 2023 06:50:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id EEA516B0071 for ; Fri, 22 Dec 2023 06:50:03 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C8EA8A1798 for ; Fri, 22 Dec 2023 11:50:03 +0000 (UTC) X-FDA: 81594285486.05.5D3938A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf15.hostedemail.com (Postfix) with ESMTP id E0DE0A001A for ; Fri, 22 Dec 2023 11:50:01 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CRURTACp; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf15.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=1703245802; 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=b2Kc5SDyR2sa98m7GGfG0OJjTCYVmXAF9D404GjbeCw=; b=ugu554BwiQEK3yKjomgwFObJA+YLktY4YBXKzhIBZqPT9VDG3KQkLjmbP6+W8awPT/ZO4D LjJiwYjI1iD/nh4lRPBMrOnADnUdxlLXQgDSaJJsFS7mmy3+A6AkVnMle8pjKsz8Gm6oYo +DCXbjiZnvgJJSf27Edy8DdLkPBm0Qk= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CRURTACp; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf15.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703245802; a=rsa-sha256; cv=none; b=f5avYBj+iGxooGutf7mPE1yE+PJNmRGk3Jvo/zbm108WAWwTlia8qYpHWMY3uByu2Zm4U7 krFv4EdWsMdJXrIthYQeYVnPTme92ucW7WmDVqtGdh8l73YAPF6JByXTgE4sm5slBVo/HT H519zzEYu/sohrPDffgTVYJ+WWPQCwY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703245801; 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=b2Kc5SDyR2sa98m7GGfG0OJjTCYVmXAF9D404GjbeCw=; b=CRURTACpBzbE6yVfJaX4KXc/6LUeCQPtt4vM38/xiKaLx/ocYmIOXn4SkqIQKGb2z8ORuT r70yfFF5lqiCTV3ETWJivYzIni+PTp/unvK267+sX5+kN8/rW9fPz9JXGPQuUcz2PIwdGb ywxsydgxB1JzfnYWN44BEoxrNu1wh/M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-399-gMeN3nQqMpKa8ASINIbPcw-1; Fri, 22 Dec 2023 06:49:57 -0500 X-MC-Unique: gMeN3nQqMpKa8ASINIbPcw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2C45868A20; Fri, 22 Dec 2023 11:49:55 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.39.195.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71FCC2026D66; Fri, 22 Dec 2023 11:49:52 +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: <20231221230153.GA1607352@dev-arch.thelio-3990X> References: <20231221230153.GA1607352@dev-arch.thelio-3990X> <20231221132400.1601991-1-dhowells@redhat.com> <20231221132400.1601991-38-dhowells@redhat.com> To: Nathan Chancellor , Anna Schumaker , Trond Myklebust Cc: dhowells@redhat.com, Jeff Layton , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Dominique Martinet , Eric Van Hensbergen , Ilya Dryomov , Christian Brauner , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 37/40] netfs: Optimise away reads above the point at which there can be no data MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2202547.1703245791.1@warthog.procyon.org.uk> Date: Fri, 22 Dec 2023 11:49:51 +0000 Message-ID: <2202548.1703245791@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Rspamd-Queue-Id: E0DE0A001A X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: cxpcue6acuueyp14jextoesgcshbgsqx X-HE-Tag: 1703245801-378501 X-HE-Meta: U2FsdGVkX1/PJoq0msvlB3rzZ4QD/Srj09f4aet7C36rqzglhhoaQ4d1WccBoEmiLZwddAw7CfATv19KHsMx22zXMhWUzvYSB/m9WPukLmorCLAKw2nKL8oMbfc1tA3vZOvqD+KqdYelCqYx/OY830zhTOi1FkJdibhWUf9Mr2D4jsoGFgvyRUO3ixptFEmWWhLwjamWmv6tsdL5qDvpzPQjTukPVc4EwXHANY+k7c3jl2w3WnYvf0DTcqtMnwPbLudSHCNzkuVDqZd/jaE/1ptniWLU0QRTWFqM+dC9GfIgLlrqnbuFuAoFu4C5mgeKK+haIuw0tDXizJ0ZTivzZwlw7e92xFwK12yKyZU3O3vs8PiMRT0E0ShL1HJlLUxdLXnqV1RSeahYZCc/IJvIwojmzrX/YGZzMGTgRkIJR0/4wXkLa9gObk9+lvrmMo20GmdSz/BkvUD+7d9OCrFzDaFQ4PALo5zImcdyVBVZCmm062WdHBIU0M6/NCGI5DexSlXqwTuj3jqapApLZKFGwL1Z5MeBLb7+IJR0RmMajYvjs2vVyK0/wHBVsdyksG8cFiUtaEYQJ+RtXRbm6PPCNk8S5d6I6/YWyMA+s+kcObHiI/sag1HZtQ6i8MQ0fwMlvF/2ZHdUNrYLrXS8H8DRG7tWqJZrLnfQjDL+u3gLEQoXV/DtUSEO5BJSKHRaCRVqLwqESl2Hv8QKfdRrINHxFUSIncVpGl8y7Th3NiDqCLV9DggaWgejM6OI320UtvOy1wOPS6IA4tpTjIIXLDy+4nW7fkkNumLSQlImELBr3r1rQj2Dzxl2+ubkPYzsMfxn05eBp9C0GjtyJdBrHDdxZSsmGhtSEnRfnJrNgrKvAKsnnuhMGhVmnYnoZAyEbfThokCmwWF11lEflvygXvVztTETsHp5/oLCM3S/lpXWZSBCBMP5MfVywceEsKHStWtzUjLdXYn9HfEqBc0cb/M Uh019fE5 5x2vZkZaZ3AT+CCDOttuz5GIzBOttZCr+/m5u0qCNzPgvG/DKmR6JTyYlZ5meej7W7bLjYmq7LsnsWEBGWVOmDQeg2KXNcXTocSskgeqxtj7QshmIczlZZTQEyWaE2u3JUOJeIn9pvHj+FOf4K2bKWHaThV/ORO2eD32KcvSpiDQn0DsbukAg22YgV/wR4vih743F9AyO+yOpyJefpg9wtUkn1A== 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: List-Subscribe: List-Unsubscribe: Nathan Chancellor wrote: > It appears that ctx->inode.i_mapping is NULL in netfs_inode_init(). This > patch appears to cure the problem for me but I am not sure if it is > proper or not. I'm not sure that's the best way. It kind of indicates that nfs_netfs_inode_init() is not being called in the right place - it should really be called after alloc_inode() has called inode_init_always(). However, mapping_set_release_always() makes ->release_folio() and ->invalidate_folio() always called for an inode's folios, even if PG_private is not set - the idea being that this allows netfslib to update the "zero_point" when a page we've written to the server gets invalidated here, thereby requiring us to go fetch it again. Now, NFS doesn't make use of this feature and fscache and cachefiles don't use it directly, so we might not want to call mapping_set_release_always() for NFS. I'm not sure NFS can even reliably make use of it unless it's using a lease unless it gets change notifications from the server. So I'm thinking of applying your patch but add a comment to say why we're doing it. A better way, though, is to move the call to nfs_netfs_inode_init() and give it a flag to say whether or not we want the facility. David