linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"chuck.lever@oracle.com" <chuck.lever@oracle.com>
Subject: Re: [PATCH] SUNRPC: Remove rpc_xprt::tsh_size
Date: Thu, 3 Jan 2019 18:47:57 +0000	[thread overview]
Message-ID: <0331de80b8161f8bf16a92de20049cafb0c228da.camel@hammerspace.com> (raw)
In-Reply-To: <20190103182649.4148.19838.stgit@manet.1015granger.net>

On Thu, 2019-01-03 at 13:29 -0500, Chuck Lever wrote:
> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> index d5ce1a8..66b08aa 100644
> --- a/net/sunrpc/xprtsock.c
> +++ b/net/sunrpc/xprtsock.c
> @@ -678,6 +678,31 @@ static void xs_stream_data_receive_workfn(struct
> work_struct *work)
>  
>  #define XS_SENDMSG_FLAGS	(MSG_DONTWAIT | MSG_NOSIGNAL)
>  
> +static int xs_send_record_marker(struct sock_xprt *transport,
> +				 const struct rpc_rqst *req)
> +{
> +	static struct msghdr msg = {
> +		.msg_name	= NULL,
> +		.msg_namelen	= 0,
> +		.msg_flags	= (XS_SENDMSG_FLAGS | MSG_MORE),
> +	};
> +	rpc_fraghdr marker;
> +	struct kvec iov = {
> +		.iov_base	= &marker,
> +		.iov_len	= sizeof(marker),
> +	};
> +	u32 reclen;
> +
> +	if (unlikely(!transport->sock))
> +		return -ENOTSOCK;
> +	if (req->rq_bytes_sent)
> +		return 0;

The test needs to use transport->xmit.offset, not req->rq_bytes_sent
You also need to update transport->xmit.offset on success, and be
prepared to handle the case where < sizeof(marker) bytes get
transmitted due to a write_space condition.

> +
> +	reclen = req->rq_snd_buf.len;
> +	marker = cpu_to_be32(RPC_LAST_STREAM_FRAGMENT | reclen);
> +	return kernel_sendmsg(transport->sock, &msg, &iov, 1,
> iov.iov_len);


So what does this do for performance? I'd expect that adding another
dive into the socket layer will come with penalties.


-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  reply	other threads:[~2019-01-03 18:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03 18:29 [PATCH] SUNRPC: Remove rpc_xprt::tsh_size Chuck Lever
2019-01-03 18:47 ` Trond Myklebust [this message]
2019-01-03 20:53   ` Chuck Lever
2019-01-03 21:07     ` Chuck Lever
2019-01-03 21:28       ` Trond Myklebust
2019-01-03 21:35         ` Chuck Lever
2019-01-03 22:49           ` Chuck Lever
2019-01-04  4:00             ` Trond Myklebust
2019-01-04 21:35               ` Chuck Lever
2019-01-04 22:44                 ` Trond Myklebust
2019-01-10 17:13                   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0331de80b8161f8bf16a92de20049cafb0c228da.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).