Re: [nfsv4] Credit management and one-way messages

Chuck Lever <chuck.lever@oracle.com> Mon, 07 August 2017 21:46 UTC

Return-Path: <chuck.lever@oracle.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8C2E1128C9C for <nfsv4@ietfa.amsl.com>; Mon, 7 Aug 2017 14:46:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.22
X-Spam-Level:
X-Spam-Status: No, score=-4.22 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FjDYSEtANk2V for <nfsv4@ietfa.amsl.com>; Mon, 7 Aug 2017 14:46:23 -0700 (PDT)
Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8E4101201F2 for <nfsv4@ietf.org>; Mon, 7 Aug 2017 14:46:23 -0700 (PDT)
Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v77LkL3I009631 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Aug 2017 21:46:22 GMT
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v77LkLYi015470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Aug 2017 21:46:21 GMT
Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v77LkLAu021897; Mon, 7 Aug 2017 21:46:21 GMT
Received: from anon-dhcp-171.1015granger.net (/68.46.169.226) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Aug 2017 14:46:21 -0700
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Chuck Lever <chuck.lever@oracle.com>
In-Reply-To: <CADaq8jc5D99YBM9d_78L0_CGyF-81xB-oE6RsXdnCof8Lhn_qg@mail.gmail.com>
Date: Mon, 07 Aug 2017 17:46:20 -0400
Cc: "nfsv4@ietf.org" <nfsv4@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <8D28B73B-29A3-4C33-A9B0-B04182D68859@oracle.com>
References: <CADaq8jf8s+qpgC25d75Jm4=Mk9mcb5=TEYpKR9AzkczgV7dwag@mail.gmail.com> <56B97007-87A7-4FBC-9DA0-530EA585AD57@oracle.com> <CADaq8jc5D99YBM9d_78L0_CGyF-81xB-oE6RsXdnCof8Lhn_qg@mail.gmail.com>
To: David Noveck <davenoveck@gmail.com>
X-Mailer: Apple Mail (2.3124)
X-Source-IP: userv0022.oracle.com [156.151.31.74]
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/o7pdUzsTjFN02fZ5Ai60EuN_eRM>
Subject: Re: [nfsv4] Credit management and one-way messages
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4/>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 07 Aug 2017 21:46:26 -0000

> On Aug 1, 2017, at 1:51 PM, David Noveck <davenoveck@gmail.com> wrote:
> 
> Ouch!!
> 
> If i was addressing an unduly narrow problem, it was because it was framed around the difficulties that might be added by adding one-way messages such as those added by Version 2.  If you consider, as I guess makes sense, RPCs that are not replied to as effectively one-way messages, that puts an entirely different spin (of possibly high angular momentum) on the problem.
> 
> Let me try to start addressing this larger problem.  I hope it doesn't make anyone (else) dizzy.
> 
> One reason that this is hard to address is that we have different views regarding the roles of the credit management logic regarding replies.  In my view, there is no point in a requester trying to give a credit to the responder allowing the responder to send the response to the requester.  I thought that the right thing was for the requester to ensure that the responders response could be read was for the requester to post a receive (or ensure that one was present) before sending the request.  I though that this happened outside the ambit of credit management because there is no real need for it to be within the scope of credit  management.  The requester can be responsible for providing receives corresponding with in-flight requests without involving the responder in the decision, which involves complexity, especially when multipeRPC directions are involved.  I never found anythng in the spec that told me I was wrong in that, but i just may be missing it.
> 
> I think we discussed this a while ago but no change in the spec was made to either make it clear I was wrong, or indicate that I was right.  My recollection is that you treated my observation as correct/valid implementation advice and we never really addressed our different interpretations of the spec.  It seems to me that the spec was ambiguous on this point.   Of course, I might not be seeing something that is there and you might be simply assuming that something is implied because it seems natural, even if it is not explcitly there.

Another interpretation is that the spec describes only protocol,
and that after some trial-and-error, implementers will conclude
that there are only one or two ways to implement that protocol.


> If the spec still is not clear on this point, it might need to be fixed, if not to mandate my approach but at least to indicate how the requester can safeguard itself against the possibility that a response sent by the responder will cause a disconnect.
> 
> With this approach, RPC's not replied to would still be a problem, but the problem cannot result in a disconnect.  For each not-replied-to request, there would be a receive that was not included in the credits, which would be devoted in this model to receives for receiving requests (and things intended to be one-way messages).   Of course, with 1K or 4K buffers that would not be such a big deal and you could defer any connection reset until a time when it was easy to do.  

A requester is responsible for posting enough receive buffers to
catch Replies for all outstanding RPC Calls. So either:

A. It can post a receive buffer as part of preparing to send a Call.
If a Reply is missed, that receive is still posted. The requester
has to accommodate for that.

B. It can batch-post receive buffers (say, as part of receive
completion handling) in order to keep more than enough available.

The problem, as I see it, occurs when a responder wants to send a
one-way message to a requester. In scenario A, that knocks down a
receive buffer that was intended to catch a Reply. The requester
is responsible for getting a replacement receive buffer posted,
but there's a possibility that it could not do so fast enough
to catch other incoming messages.

This is the fundamental issue with one-way messages. A sender
has no way to know when the receiver is prepared to receive
additional messages because there is no message acknowledgement
in RPC-over-RDMA version 1, other than RPC Call and Reply messages.


A responder is responsible for posting enough receive buffers to
catch "credit" RPC Calls. It relies on the fact that requesters
can't keep more than "credit" RPC Calls in flight, to know exactly
how many receive buffers it needs to keep posted. So either:

A. It posts "credit" receive buffers when accepting a connection,
and then it posts a receive buffer as part of preparing to send a
Reply. If sending fails, that receive is still posted, and the
responder has to accommodate for that.

B. It can batch-post receive buffers in order to keep more than
enough available.

The problem, as I see it, occurs when a requester sends enough
one-way messages that it prevents the transmission of more
RPC Calls. The responder cannot send Replies to those one-way
messages, so the requester has no way to know when the responder
is ready to receive another RPC Call.


I think that credit management will have to take a different
form if we believe one-way messages are a necessary part of the
future of RPC-over-RDMA.


--
Chuck Lever