Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3775074pxu; Mon, 30 Nov 2020 10:00:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1l6xXXMLiLPG+ZrlufCsAuQs4bBOaj5TIK1Qvk6uHs+MAq46eEUIP4IoCHdUG4M9Jwrm2 X-Received: by 2002:a50:fd8d:: with SMTP id o13mr23583491edt.248.1606759208483; Mon, 30 Nov 2020 10:00:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606759208; cv=none; d=google.com; s=arc-20160816; b=uJcn3tGjJ1/si56D3m53x7NYljevVjr0MrxeHY2/JK8bZdqbGsQNadfXUu/GV65Kya 3qrZR35+2u3gLEjZPherXPT5v0qkMqQk8gJuZNE2H7AM1mtcAxh8WaDAlvA8vRMXx2/N YgLTy7ZxRyXF9y/dhFGXGTpDxVpazPj9tQVBPeNFiJnhsGqqgNBrXqM9LswIKz5nzUAM 83cJbUfiO4ySqSCvj4Tc33fck8tpM48czrz9nSULq8tWevbQO3dj8BIY5B4DX9wuHQYE IqV5H3S1dXEO65vWKH3CK0SFniVB2gRsSR2NiokVivHZ2dTbCYIS52wIu5wv44vI/+C8 8EoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=UrMw4oKWVr2caQDiqCZs6p2wI9b7V+rbf0CXAyWmTZU=; b=BN6Zxi9LZODRXYfbYu4o3d5X69+0dv3FUXbyC+NjEgBFio2VVQ7Wb+6gL2PVTe4dwu vGO9TRPm9YC5yDs57YNEAwwdLAhjXUzDuuIQ722OIoaJKd4eMddMnH/JRYax2fO/h7pX 5uYkCBKx8ydwpz02/kq0F+jB4/0mapX2OaM/t+aBVHz8qfB8c9USraAplgY1exMNG/uL Dae1fA0+9BHr9IhF6keUvxUT66SI3SDJDdltaXBQrJT19YHgBV2KY3Kz2j90KQpX7Bhi 47IDPWSg/G1C9s+7mSFDDcBfwJjvhJub9nRfDt5JCLtNwOdDkGFjid+FWEzZPEjKo3Gh g+8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Skyin5RA; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r5si7193874edo.330.2020.11.30.09.59.03; Mon, 30 Nov 2020 10:00:08 -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=@gmail.com header.s=20161025 header.b=Skyin5RA; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728181AbgK3R6W (ORCPT + 99 others); Mon, 30 Nov 2020 12:58:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727952AbgK3R6W (ORCPT ); Mon, 30 Nov 2020 12:58:22 -0500 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB042C0613CF for ; Mon, 30 Nov 2020 09:57:41 -0800 (PST) Received: by mail-qt1-x844.google.com with SMTP id u21so2989749qtw.11 for ; Mon, 30 Nov 2020 09:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UrMw4oKWVr2caQDiqCZs6p2wI9b7V+rbf0CXAyWmTZU=; b=Skyin5RAZCsy15/+SPZicUcCnxYvsApRZELJmJHXtWNGM54yPSHfm+lItVcFusgZiX DuB0zceJMzBzvNxSLJ9TnAmkR+9XpsFASJsosJSQW2y0zXnhUOwInatnSjCEZg1HAXRn hQqWxTyFE0EIZU4iBzH5e9FvB9Qc3K10Xa3LRcQvn5UMQUL9TRyBBFpexVZEHuqBBvlh TLPLynjUYURoQW28mBi73LFr91pr76hKExPmVeY8dm138HOUUEYwAWg0GzLDWVaGSgWM 7JRmWcSwYpOSlky440MLJ4/Ho6gok+eg6ja7T14GwpkkzkW2HzRO7wJBX+ugZdYVVew/ oMiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UrMw4oKWVr2caQDiqCZs6p2wI9b7V+rbf0CXAyWmTZU=; b=FzhUQZRfEzRF4pTL8pipYU9xVf4wh8eQtIEyPkyAEPYZLQ6XnCh1yZWEFS0VGqJRJU tyaeGUTgq2sJLsbpjXiwsIIg4zaHp3Y0zLtgS3XsIXjlVMApae+J2RHaKA+XzlnonrP1 Jv2h4dIkcKxwYT0Kon44rhXMnqFQzze/GbNTgA5BnwG4rtLn/P2tI9BV4jnkXERMTFCg qAimcO0DS3Ft2GcgST/IA87+F79qEIvVskRygg+lpc8TIkNnRWHfhAzji+dTE8BGG5UV MsFJMT3/vsN5ABCo9dZNHG+EtqnBaaAeFi0xLvZY/q+h8+7gxp6ZpLhId7VqmLbHoYi5 ODjg== X-Gm-Message-State: AOAM532SoFbaKJiudwamb4cE0vkbVLPhPRdsf/E7MpP6khHHJN6pz2JF pihD05pT4xyJqokcnBMxFr4= X-Received: by 2002:ac8:7445:: with SMTP id h5mr22860975qtr.334.1606759061136; Mon, 30 Nov 2020 09:57:41 -0800 (PST) Received: from anon-dhcp-152.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id i4sm16184659qtw.22.2020.11.30.09.57.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2020 09:57:40 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [PATCH] NFSD: Fix 5 seconds delay when doing inter server copy From: Chuck Lever In-Reply-To: <20201124204956.GB7173@fieldses.org> Date: Mon, 30 Nov 2020 12:57:39 -0500 Cc: Bruce Fields , Linux NFS Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: <9C1255B8-F52F-4797-9E2E-EF7EBE60C613@gmail.com> References: <20201124031609.67297-1-dai.ngo@oracle.com> <20201124204956.GB7173@fieldses.org> To: Dai Ngo X-Mailer: Apple Mail (2.3608.120.23.2.4) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hello Dai - > On Nov 24, 2020, at 3:49 PM, J. Bruce Fields = wrote: >=20 > On Mon, Nov 23, 2020 at 10:16:09PM -0500, Dai Ngo wrote: >> Since commit b4868b44c5628 ("NFSv4: Wait for stateid updates after >> CLOSE/OPEN_DOWNGRADE"), every inter server copy operation suffers 5 >> seconds delay regardless of the size of the copy. The delay is from >> nfs_set_open_stateid_locked when the check by = nfs_stateid_is_sequential >> fails because the seqid in both nfs4_state and nfs4_stateid are 0. >>=20 >> Fix by modifying the source server to return the stateid for = COPY_NOTIFY >> request with seqid 1 instead of 0. This is also to conform with >> section 4.8 of RFC 7862. >>=20 >> Here is the relevant paragraph from section 4.8 of RFC 7862: >>=20 >> A copy offload stateid's seqid MUST NOT be zero. In the context of = a >> copy offload operation, it is inappropriate to indicate "the most >> recent copy offload operation" using a stateid with a seqid of zero >> (see Section 8.2.2 of [RFC5661]). It is inappropriate because the >> stateid refers to internal state in the server and there may be >> several asynchronous COPY operations being performed in parallel on >> the same file by the server. Therefore, a copy offload stateid = with >> a seqid of zero MUST be considered invalid. >>=20 >> Fixes: ce0887ac96d3 ("NFSD add nfs4 inter ssc to nfsd4_copy") >> Signed-off-by: Dai Ngo >> --- >> fs/nfsd/nfs4state.c | 1 + >> 1 file changed, 1 insertion(+) >>=20 >> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c >> index d7f27ed6b794..33ee1a6961e3 100644 >> --- a/fs/nfsd/nfs4state.c >> +++ b/fs/nfsd/nfs4state.c >> @@ -793,6 +793,7 @@ struct nfs4_cpntf_state = *nfs4_alloc_init_cpntf_state(struct nfsd_net *nn, >> refcount_set(&cps->cp_stateid.sc_count, 1); >> if (!nfs4_init_cp_state(nn, &cps->cp_stateid, = NFS4_COPYNOTIFY_STID)) >> goto out_free; >> + cps->cp_stateid.stid.si_generation =3D 1; >=20 > This affects the stateid returned by COPY_NOTIFY, but not the one > returned by COPY. I think we wan to add this to nfs4_init_cp_state() > and cover both. Since time is creeping on towards the next merge window, I assume this particular fix needs to go there, but I don't see the final version of it (with Bruce's suggested fix) on the list. Did I miss it? >> spin_lock(&nn->s2s_cp_lock); >> list_add(&cps->cp_list, &p_stid->sc_cp_list); >> spin_unlock(&nn->s2s_cp_lock); >> --=20 >> 2.9.5 -- Chuck Lever chucklever@gmail.com