Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp476475pxu; Tue, 1 Dec 2020 16:38:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqo3n91xCW2Sl2ThtvufFp/njylvtdZlmgr4MxK2a7fNvCyve268Bf44N0zEOTHzw5Oozm X-Received: by 2002:a50:b021:: with SMTP id i30mr210644edd.270.1606869519092; Tue, 01 Dec 2020 16:38:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606869519; cv=none; d=google.com; s=arc-20160816; b=gjTk/4ZxOML9CZDeX2UMTniQn7Eitfm3gnMfOT3Kfr5A31U0b1JRRuC45e1kMXT70M FruccAb+oBFZYMmsytdUMtmlBvLRlzjSkdpZn5YfYhXksJyMOvFT88m5PwJPrTYNS1yd 5tB5ubIiEgk6NTU1xLPUwDFHtTJRV3Wdv4QKWRUyiwWwUBRRdMmh775HRDXzI+v0lr1P skVykpgW1/KBCmjHhtzsMdSolqKHToESbJXR2VHE8blorFumvgpo4oQlvetPG+L79Mbg 5V0/muLXf0UFAcEztapab4G0EiVqEyxoW0viLVtiiXOB8VnCwlm8LRn8ZpHwMWiy3qAw VQZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:cc:to:from:date:subject :dkim-signature; bh=DPL5vClCfQqITfS9On23vLPz8P0aktLF0c1pqIZD1Fk=; b=dOEs0QO0jnnheJPFDjSTE6QRiCUdxleS+hYQDw1ulwoJc6HyFt/d1JQMKDwaIUtJc/ 70ecAEkcIQIwSKaIZ+3/nI75FdlbVZrsCyR3RZQxM08b1Kp3kVLd82NLh/5286BZ+LZd NwypWW0BDp0P3GjJWza8TNmrteDD7dxjJ16VXlmgTgOi6Ey5IQDnSy7+VOiVr+RvhLF6 KTRN1F3gJ0oa9FqeJLI1j2EvktFZi6Bu0fRoOtGGyty6iIuk7JubIqX2+W6Y/imzpRI9 wUTwkTnfRRzukNCPwkDVZIPxaIefytHDqDXdH8Vr97DiF1m3ibJLYvqA/Ai+O6r9QVZg uLxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=HI6ndoZs; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq10si919112ejc.616.2020.12.01.16.38.15; Tue, 01 Dec 2020 16:38:39 -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; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=HI6ndoZs; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727455AbgLBAhd (ORCPT + 99 others); Tue, 1 Dec 2020 19:37:33 -0500 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:53412 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727289AbgLBAhc (ORCPT ); Tue, 1 Dec 2020 19:37:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1606869452; x=1638405452; h=date:from:to:cc:message-id:references:mime-version: in-reply-to:subject; bh=DPL5vClCfQqITfS9On23vLPz8P0aktLF0c1pqIZD1Fk=; b=HI6ndoZsaWVova6xwNJQMmC0sTcPGJpnnpQzfLQ1CVodOuaLkB/hx/p6 e/tIwG9KuoFFugvW3WES3UPdQ+i4+oaCKeuR6hwFuUUCQ8xQTnZ5i9N/g 50TDKmDPKL2o2BFA78RFJIHtFDz7HnjJZEXp0e6mI3VcjgnC3wQuegNO4 E=; X-IronPort-AV: E=Sophos;i="5.78,385,1599523200"; d="scan'208";a="100973487" Subject: Re: [PATCH] NFSv4.2: improve page handling for GETXATTR Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2b-4ff6265a.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 02 Dec 2020 00:36:46 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2b-4ff6265a.us-west-2.amazon.com (Postfix) with ESMTPS id BF9E7A042C; Wed, 2 Dec 2020 00:36:44 +0000 (UTC) Received: from EX13D03UEA003.ant.amazon.com (10.43.61.39) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Dec 2020 00:36:44 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D03UEA003.ant.amazon.com (10.43.61.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Dec 2020 00:36:44 +0000 Received: from dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (172.23.141.97) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 2 Dec 2020 00:36:44 +0000 Received: by dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (Postfix, from userid 6262777) id D3B46C1321; Wed, 2 Dec 2020 00:36:43 +0000 (UTC) Date: Wed, 2 Dec 2020 00:36:43 +0000 From: Frank van der Linden To: Olga Kornievskaia CC: Trond Myklebust , "linux-nfs@vger.kernel.org" , "anna.schumaker@netapp.com" , "chuck.lever@oracle.com" Message-ID: <20201202003643.GB720@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> References: <20201201213128.13624-1-fllinden@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Dec 01, 2020 at 06:03:31PM -0500, Olga Kornievskaia wrote: > On Tue, Dec 1, 2020 at 5:15 PM Trond Myklebust wrote: > > > > On Tue, 2020-12-01 at 21:31 +0000, Frank van der Linden wrote: > > > XDRBUF_SPARSE_PAGES can cause problems for the RDMA transport, > > > and it's easy enough to allocate enough pages for the request > > > up front, so do that. > > > > > > Also, since we've allocated the pages anyway, use the full > > > page aligned length for the receive buffer. This will allow > > > caching of valid replies that are too large for the caller, > > > but that still fit in the allocated pages. > > > > > > Signed-off-by: Frank van der Linden > > > --- > > > fs/nfs/nfs42proc.c | 39 ++++++++++++++++++++++++++++++--------- > > > fs/nfs/nfs42xdr.c | 22 +++++++++++++++++----- > > > 2 files changed, 47 insertions(+), 14 deletions(-) > > > > > > diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c > > > index 2b2211d1234e..bfe15ac77bd9 100644 > > > --- a/fs/nfs/nfs42proc.c > > > +++ b/fs/nfs/nfs42proc.c > > > @@ -1176,11 +1176,9 @@ static ssize_t _nfs42_proc_getxattr(struct > > > inode *inode, const char *name, > > > void *buf, size_t buflen) > > > { > > > struct nfs_server *server = NFS_SERVER(inode); > > > - struct page *pages[NFS4XATTR_MAXPAGES] = {}; > > > + struct page **pages; > > > struct nfs42_getxattrargs arg = { > > > .fh = NFS_FH(inode), > > > - .xattr_pages = pages, > > > - .xattr_len = buflen, > > > .xattr_name = name, > > > }; > > > struct nfs42_getxattrres res; > > > @@ -1189,12 +1187,31 @@ static ssize_t _nfs42_proc_getxattr(struct > > > > Why can't we set up the page array in nfs42_proc_getxattr()? This means > > that if we get a retryable error from the server, then we perform > > multiple allocations of the same buffer. > > I wonder if the same then is needed for the LISTXATTR as we allocated > pages in _nfs42_proc_listxattr() and instead should do it in > nfs42_proc_listxattr().... There are a few more places of which this is true, yep. getactl is the other one. In any case, fixed for the getxattr case in v2. - Frank