Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3920535rdb; Mon, 11 Dec 2023 04:10:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvnxSPVVoAvWbSfx+KucwCVySM4utFEgNL6F3qBMKjrITzCn6dMixC754OMvncWDlQTQWO X-Received: by 2002:a05:6a20:b927:b0:18b:d228:fa8c with SMTP id fe39-20020a056a20b92700b0018bd228fa8cmr1714461pzb.3.1702296614328; Mon, 11 Dec 2023 04:10:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702296614; cv=none; d=google.com; s=arc-20160816; b=W8gu30H6+yVXNP2jAuKCVcsIEUzYjNhy8ZhXXPaaugun6vuqqRXaZ+OE5lE2cfkt+W FVHsAeHNUhHCG8y6AKOouuLlxeFYPS5Avd5AvgDo/tevdp4CQ3G6R+bbbzYt4YhBv9m9 e/O0RCNREWMQBmqBzraviQ0ekMdS0cKjfNHv5vDT77gmU4rwDO0sfjyg49wisCjjS6sN 05HyY0sM9lZ3YuBS4nHo4EOY/GMRYTU/L3kTuaRRpT6E95mT/Pu7LdzfVLUl9SMJb6S+ jVSjr95N9Z9PfkaXIXB3Z7iCaApa0haRjmic4adw3gEY/LOYbJaFlA2b9jag0r/BEWrC ut/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hnYm5KfX8lM8APHl62ZJ0088IHHtCECQow+H9/WQ9iE=; fh=G3i7fV6Ga7RyV8q6svsk25rDlrjMVX5rvyYwPUiOvf8=; b=iGH5NmgMxrOYdoFymX0yujpY8qGHxky0u0eM7MJWk3BE/UOLOeDWBf92dQLuwISUgQ bi8mViFIgp38Q9nX5Sc2QdDK5RZvlZVnwhYwtItb4jCv5PQGZjxvYWYdf+7q3QoUFO5/ HP8YJi5otvE6XFuCztWcVIOjhJL76w1SW0i45/UFwMTtSsw6yo4AlpPjYZQLq9pNyRC0 WsC3EOp+co/qTzEwQvCF2L3QCrf009FmnwdjbEclsUZ+31nFhpmDwHHyzswCyWaJn4S9 C8Bt3wOfRNFVGuUI0Y5zeaLhJ3p+JKvQsBB3g+xrtH8o6L93Nn36fc7RPUbX6aJ2nBPY bIHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EyjNcadl; spf=pass (google.com: domain of linux-nfs+bounces-479-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-479-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bf20-20020a17090b0b1400b0028a2944a218si27588pjb.111.2023.12.11.04.10.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 04:10:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-479-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EyjNcadl; spf=pass (google.com: domain of linux-nfs+bounces-479-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-479-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 02EB8281F04 for ; Mon, 11 Dec 2023 12:10:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F8143A279; Mon, 11 Dec 2023 12:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EyjNcadl" 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]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC0A89B for ; Mon, 11 Dec 2023 04:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702296599; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hnYm5KfX8lM8APHl62ZJ0088IHHtCECQow+H9/WQ9iE=; b=EyjNcadltUXyQUSjcZurdxE6QJV7UxkgS99QCD2nrWVkJvwq//4Xy6O/WC03yXz9gXti4D p1koHQ7ptOtnwH4xOv2sqjFcHaOm6yN2n1bDmnF5mXBawzMqWzGOzGE6OSEmQjPvjauI9w hoLVfhFmWV3GjkhrKGPxFf5igkAGKdY= 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-335-13hXbWqZNOChHpgE9jYzEg-1; Mon, 11 Dec 2023 07:09:56 -0500 X-MC-Unique: 13hXbWqZNOChHpgE9jYzEg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 72FB6836F20; Mon, 11 Dec 2023 12:09:56 +0000 (UTC) Received: from [100.85.132.103] (ovpn-0-7.rdu2.redhat.com [10.22.0.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DDB09492BC6; Mon, 11 Dec 2023 12:09:55 +0000 (UTC) From: Benjamin Coddington To: Trond Myklebust Cc: anna@kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH v2] SUNRPC: Fixup v4.1 backchannel request timeouts Date: Mon, 11 Dec 2023 06:53:14 -0500 Message-ID: <35D8B8C5-C025-43CA-B06E-60CD44634AD7@redhat.com> In-Reply-To: <089148135f43daaa77e4f83b199883c8b22c7b0f.camel@hammerspace.com> References: <1bcb93ab5feefca853b95a1759da5b008c204092.1702063105.git.bcodding@redhat.com> <089148135f43daaa77e4f83b199883c8b22c7b0f.camel@hammerspace.com> 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=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 On 9 Dec 2023, at 4:55, Trond Myklebust wrote: > On Fri, 2023-12-08 at 14:19 -0500, Benjamin Coddington wrote: >> After commit 59464b262ff5 ("SUNRPC: SOFTCONN tasks should time out >> when on >> the sending list"), any 4.1 backchannel tasks placed on the sending >> queue >> would immediately return with -ETIMEDOUT since their req timers are >> zero. >> We can fix this by keeping a copy of the rpc_clnt's timeout params on >> the >> transport and using them to properly setup the timeouts on the v4.1 >> backchannel tasks' req. >> >> Fixes: 59464b262ff5 ("SUNRPC: SOFTCONN tasks should time out when on >> the sending list") >> Signed-off-by: Benjamin Coddington >> --- >>  include/linux/sunrpc/xprt.h |  1 + >>  net/sunrpc/clnt.c           |  3 +++ >>  net/sunrpc/xprt.c           | 23 ++++++++++++++--------- >>  3 files changed, 18 insertions(+), 9 deletions(-) >> >> diff --git a/include/linux/sunrpc/xprt.h >> b/include/linux/sunrpc/xprt.h >> index f85d3a0daca2..7565902053f3 100644 >> --- a/include/linux/sunrpc/xprt.h >> +++ b/include/linux/sunrpc/xprt.h >> @@ -285,6 +285,7 @@ struct rpc_xprt { >>   * items */ >>   struct list_head bc_pa_list; /* List of >> preallocated >>   * backchannel >> rpc_rqst's */ >> + struct rpc_timeout bc_timeout; /* backchannel >> timeout params */ >>  #endif /* CONFIG_SUNRPC_BACKCHANNEL */ >>   >>   struct rb_root recv_queue; /* Receive queue */ >> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c >> index d6805c1268a7..5891757c88b1 100644 >> --- a/net/sunrpc/clnt.c >> +++ b/net/sunrpc/clnt.c >> @@ -279,6 +279,9 @@ static struct rpc_xprt >> *rpc_clnt_set_transport(struct rpc_clnt *clnt, >>   clnt->cl_autobind = 1; >>   >>   clnt->cl_timeout = timeout; >> +#if defined(CONFIG_SUNRPC_BACKCHANNEL) >> + memcpy(&xprt->bc_timeout, timeout, sizeof(struct >> rpc_timeout)); >> +#endif > > Hmm... The xprt can and will be shared among a number of rpc_clnt > instances. I therefore think we're better off doing this when we're > setting up the back channel. .. and it seems the timeouts could be different for each, so now I think keeping a copy of the last rpc_clnt's timeouts on the xprt is wrong. We could use the current timeouts from the nfs_client side after we figure out which nfs_client that would be in nfs4_callback_compound(). Trouble is if we have to make a reply before getting that far there's still no timeout set, but that's probably a rare case and could use the xprt type defaults. > i.e. probably doing it in nfs41_init_clientid() after we picked up the > lease time (but before we mark the client as ready), and then doing it > in nfs4_proc_bind_conn_to_session() if ever that gets called. > > Note that we have to set the bc_timeout on all xprts that could act as > back channels, so you might want to use > rpc_clnt_iterate_for_each_xprt(). > It might also be worth to look at Olga's trunking code, since I suspect > we might need to do something there when adding a new xprt to the > existing set. Ben