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 X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B30BC433E0 for ; Sun, 9 Aug 2020 21:25:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B13E7206A2 for ; Sun, 9 Aug 2020 21:25:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fieldses.org header.i=@fieldses.org header.b="PhQEAH9U" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726344AbgHIVZd (ORCPT ); Sun, 9 Aug 2020 17:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbgHIVZc (ORCPT ); Sun, 9 Aug 2020 17:25:32 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6906C061756 for ; Sun, 9 Aug 2020 14:25:32 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 9949E1CE6; Sun, 9 Aug 2020 17:25:31 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 9949E1CE6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1597008331; bh=PeLynJ9RjXf67msa6wod4M2gpFOf0ChauvrykDvcYwQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PhQEAH9U8mpE7kb4IO9OUKj7f49j/DdDvHCCsoID0f5W9zGoR8QBipuWYxV4UNWGm n3ADNa74zGoCNy/bS7JDC8CITb3d8N4LnYJuPII2tmIfspfQJ31qNi7V5kWNS60TFM LOeADQSfuX02ns6gheGO7UfhbTNIWnAADmNVg1RQ= Date: Sun, 9 Aug 2020 17:25:31 -0400 From: Bruce Fields To: Chuck Lever Cc: Linux NFS Mailing List Subject: Re: still seeing single client NFS4ERR_DELAY / CB_RECALL Message-ID: <20200809212531.GB29574@fieldses.org> References: <139C6BD7-4052-4510-B966-214ED3E69D61@oracle.com> <20200809202739.GA29574@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200809202739.GA29574@fieldses.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sun, Aug 09, 2020 at 04:27:39PM -0400, Bruce Fields wrote: > On Sun, Aug 09, 2020 at 01:11:36PM -0400, Chuck Lever wrote: > > Hi Bruce- > > > > I noticed that one of my tests takes about 4x longer on NFSv4.0 than > > it does on NFSv3 or NFSv4.[12]. As an initial stab at the cause, I'm > > seeing lots of these: > > Oops, looks obvious in retrospect, but I didn't think of it. > > In the 4.1+ case, sessions mean that we know which client every > operation comes from. > > In the 4.0 case that only works for operations that take a stateid or > something else we can link back to a client. > > That means in the 4.0 case delegations are less useful, since they have > to be broken on any (non-truncating) setattr, any link/unlink, etc., > even if the operation comes from the same client--the server doesn't > have a way to know that. > > Maybe the change to give out read delegations even on write opens > probably just isn't worth in the 4.0 case. Untested, but maybe this?--b. commit 2102ac0b68f3 Author: J. Bruce Fields Date: Sun Aug 9 17:11:59 2020 -0400 nfsd4: don't grant delegations on 4.0 create opens Chuck reported a major slowdown running the git regression suite over NFSv4.0. In the 4.0 case, the server has no way to identify which client most metadata-modifying operations come from. So, for example, the common pattern of a a setattr is likely to result in an immediate break in the 4.0 case. It's probably not worth giving out delegations on 4.0 creates. Reported-by: Chuck Lever Signed-off-by: J. Bruce Fields diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index fdba971d06c3..ce2d052b3f64 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5096,6 +5096,16 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, goto out_no_deleg; if (!cb_up || !(oo->oo_flags & NFS4_OO_CONFIRMED)) goto out_no_deleg; + /* + * In the absence of sessions, most operations + * that modify metadata (like setattr) can't + * be linked to the client sending them, so + * will result in a delegation break. That's + * especially likely for create opens: + */ + if (clp->cl_minorversion == 0 && + open->op_create == NFS4_OPEN_CREATE) + goto out_no_deleg; break; default: goto out_no_deleg;