Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2147998pxb; Fri, 29 Jan 2021 14:47:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZ9cCFYWm994p0RCUkI9EpTvabyTw4FwmnxXufZ1tKvR6Rm8aT66w7VtIo71PoI8eW5EMJ X-Received: by 2002:a05:6402:1a24:: with SMTP id be4mr1553541edb.248.1611960451259; Fri, 29 Jan 2021 14:47:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611960451; cv=none; d=google.com; s=arc-20160816; b=Zp2sTN4L7s9uE/ZBrn+bI8cY5k42yA8MwtqQN0Wq7JJvP2m5E9JRBFN9GKpIMfW1lh 1QO+hraBcb8NOyv8jdnjhHKmW3NbwZ9lKG/f5B8BgTqS9Z/H6qqSnQsy6zyalaYayFJk M0RNgzudhsz5pElAisHZHs5W0bnY5EeJC/tA6u3QPUjiviKE4DfXrRZgCEmAsen0nWLW NqW+iw7Cpoh9B+HOBcDqdlE6I6cjEycvqFUb6bPr4L54/YiZ/d6WiuJmzQueBd+BJ00u 1cqnegxxYPHvTNagj9Uo/cLsNx5c8EVmItUzfel1KzhlyytxUaoL/H2g1vSbD4u+nlE+ dejQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:references:in-reply-to :subject:cc:date:to:from; bh=6//hQd64FWh99RceuD3RJjrPBWx/ll0MavVLNc8qT7E=; b=P1a3qNoYJQYPRQ2yrl2prg4alj99NzzKv7SZ2KkfM9GZVAvAqaB8TrlOE4E2iV07Vz 4BDyfQwX2RXULHrMiFDaKVVdscqwfc6CoQY8uJNERDtEYQ2Qb2Bv6nbHhJsl9aeyhqVo U38TFNavaqoAzf4DaCfKfB/3nsqrIgaKsywbDEgqD8Q9BzXuWwuUwwjhW1a5YBhnJHoF qSuh0eEL1w24rPIVRW6WmOsoyvUgka8oHfhGl0i9pGaSwChPiK1tnbU4JlEOYvzr8eK7 C/vWR93iRbFKJDlg5v4GfvODWJV+kXaSLM030PA+dk7GWFfV7uh5DFVz/McZ3HkA+oOj F8tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si6461465edc.346.2021.01.29.14.46.56; Fri, 29 Jan 2021 14:47:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232682AbhA2WoR (ORCPT + 99 others); Fri, 29 Jan 2021 17:44:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:57674 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232778AbhA2WoM (ORCPT ); Fri, 29 Jan 2021 17:44:12 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A31E7AC48; Fri, 29 Jan 2021 22:43:27 +0000 (UTC) From: NeilBrown To: Chuck Lever Date: Sat, 30 Jan 2021 09:43:23 +1100 Cc: Linux NFS Mailing List Subject: Re: releasing result pages in svc_xprt_release() In-Reply-To: <811BE98B-F196-4EC1-899F-6B62F313640C@oracle.com> References: <811BE98B-F196-4EC1-899F-6B62F313640C@oracle.com> Message-ID: <87im7ffjp0.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org --=-=-= Content-Type: text/plain On Fri, Jan 29 2021, Chuck Lever wrote: > Hi Neil- > > I'd like to reduce the amount of page allocation that NFSD does, > and was wondering about the release and reset of pages in > svc_xprt_release(). This logic was added when the socket transport > was converted to use kernel_sendpage() back in 2002. Do you > remember why releasing the result pages is necessary? > Hi Chuck, as I recall, kernel_sendpage() (or sock->ops->sendpage() as it was then) takes a reference to the page and will hold that reference until the content has been sent and ACKed. nfsd has no way to know when the ACK comes, so cannot know when the page can be re-used, so it must release the page and allocate a new one. This is the price we pay for zero-copy, and I acknowledge that it is a real price. I wouldn't be surprised if the trade-offs between zero-copy and single-copy change over time, and between different hardware. NeilBrown --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJCBAEBCAAsFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAmAUj4sOHG5laWxiQHN1 c2UuZGUACgkQOeye3VZigbnL+BAAuzkaasYeGC06W3kY6RDIjXrvKoOTN82PpSm0 Qxmc+D4RrZX8sH8kR+uAWEaaAxZjs5IHWQ1LLGNF5ccI8oGsdjeZv3oalL+wlnQe 1Yga/UQhwEpnVIQjIdzDiALydQgObzt2OQsOyd3kDpAnvujQ+vTnpQSe0gyWoQvr UHEAla5cgGXgl1xygpeq452QCgLZ1QllBb3RCimL+PkDRQqr32ytdXPGuS9wylOb KXv/UelNRU6NDMHytMIoQNPQTsn6bSc4CaOfWsaFRfp0GEsnsY7U1eQHOQWwPl1P tzCF/BjoUipr50WhLimVE5YC7F3mgZ8BeCskUgc+GUsbB/uZ2xjfysuu0GFtIS2G 2VGqZXQNYWEEDw0Y1ozfrSPGEAqVQTTUZnYhQUW2cda+qrTDOHZo5Cj5PisJffav nPVjsZaWRK6DLByEnKJgN3DaCOdj3SgNmHpcSl8BhGVIafpSMZm/jqBHSOZHgTrM 9b37NlWXnqMXPLTApOmsSUsggosThFvmzRAbEOMizj16NnY3iA6hhtHcBcPjrhSy amkLR4a7wo0RolCNMEDr73EaWXpcWFWWZqxkT9fyHOYPsINbTOKb0sGwkMVUlIFI /5JZBxTCIBJzsm5BkaSIkqHggGNlnV9DeG8wF4U40p6AmCaWTth2BS+7hF6qH9B5 j8TRJlU= =D0gN -----END PGP SIGNATURE----- --=-=-=--