Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp740322rdb; Fri, 22 Dec 2023 03:50:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxazxB3BGmpGbJsWarU2lLGwkSnE+cuk+Sd7FNuBAG+r3qYZQtJxErmE2kyujCXLmOtXD6 X-Received: by 2002:a17:906:af93:b0:a23:6b6e:22f with SMTP id mj19-20020a170906af9300b00a236b6e022fmr726390ejb.37.1703245805516; Fri, 22 Dec 2023 03:50:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703245805; cv=none; d=google.com; s=arc-20160816; b=0wIvwukIt8tECiEMOjXzC2q8VPDMeCYCC18umMP16BJnCXmEZPq2ZvGCP6AvKljgJ6 YjWUc8pazL2Ep9B6rSkObTPq4hy6FeNQtv2pZfzLm8u2bKbjvA4cYP0fyPsJw5VmlyLO fNHZ16nAORFo+7RZEDtotdb6921YsAjQiyCEvsIiYPZ1eb3PTgu6Fhy0kJ7UZnj8y+D1 GcqTeb4/C0dOcnqn/2Bn5kBAtYfPTi9743IDJ/y8gXM2LPgFuAai1OIuR27OgsAj/arn RlHmXnu+kITRXTJELZKanvL82bt12a613+SUoGQUQsrBqV/8N8Y8grIIysR75LHzbTzC WeVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:cc:to:references :in-reply-to:from:organization:dkim-signature; bh=b2Kc5SDyR2sa98m7GGfG0OJjTCYVmXAF9D404GjbeCw=; fh=gw8B5pDdwLsYBu/57pCI+HlHl3tS+eQk9FXUig0TBEg=; b=n2zdC4aXLE4aqLAWVU+UDa2gdJVHbdyfvSIdP4DpSzpxvNxxAWWIGGUwW0/ayjLJdg XRUF3l+I+l35sHMGwb1KvuvuZwOvoCOpHVAfkIuNoXIJ05GkFlz889Tw4cjYny4OYfDd roXp3WEm3ugsTHygRMlHO4y11JqbBonk+dxXKJIdzCphbAgNOMnSzxdKSj4COGWYnyxo Z5quw0wDNBnvZosLhFz4ZT/eeRaA4xJgVQu2SNr0jau20bSGddiTXXIBWmRv/5ZVXh4t Bi6PBxYsHGN9bCqobfI1U089/AielOQTn5tx/B9pEvqLZ/fwr+vCRXDyHJggmvk8/XW3 igWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dUXfjEMP; spf=pass (google.com: domain of linux-nfs+bounces-774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g13-20020a170906c18d00b00a23149214c6si1784008ejz.354.2023.12.22.03.50.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 03:50:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dUXfjEMP; spf=pass (google.com: domain of linux-nfs+bounces-774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3F32D1F230C5 for ; Fri, 22 Dec 2023 11:50:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B1C317992; Fri, 22 Dec 2023 11:50:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dUXfjEMP" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA49017983 for ; Fri, 22 Dec 2023 11:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703245799; 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=dUXfjEMPR1tkFnblxEMBDU5zHzcD8E0XYnC3YauqTp0VIiKssNTz9Z28Uc9BKCNmAcVGqZ JwtXVIIS22dUNRuKy6m3LX47RpfRdHX458TaD5+2htbrPBSeom2CTjlkjxDdyD2pXAu2sK CfXvL1TzveNPApf/jS/yqOimK47BYu8= 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 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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