From: Bruce Fields <bfields@fieldses.org>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] SUNRPC: Use MSG_SENDPAGE_NOTLAST when calling sendpage()
Date: Wed, 7 Oct 2015 16:08:31 -0400 [thread overview]
Message-ID: <20151007200831.GB27924@fieldses.org> (raw)
In-Reply-To: <1444240482-11287-1-git-send-email-trond.myklebust@primarydata.com>
On Wed, Oct 07, 2015 at 01:54:42PM -0400, Trond Myklebust wrote:
> If we're sending more pages via kernel_sendpage(), then set
> MSG_SENDPAGE_NOTLAST.
Given that we've survived without this a while, I assume this is a hint
that may provide better performance in some cases (have you seen that?)
and that it doesn't have to be 100% correct?
In which case, looks fine, will queue up for 4.4....
--b.
>
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
> net/sunrpc/svcsock.c | 2 +-
> net/sunrpc/xprtsock.c | 4 +++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
> index 0c8120229a03..48923730722d 100644
> --- a/net/sunrpc/svcsock.c
> +++ b/net/sunrpc/svcsock.c
> @@ -181,7 +181,7 @@ int svc_send_common(struct socket *sock, struct xdr_buf *xdr,
> struct page **ppage = xdr->pages;
> size_t base = xdr->page_base;
> unsigned int pglen = xdr->page_len;
> - unsigned int flags = MSG_MORE;
> + unsigned int flags = MSG_MORE | MSG_SENDPAGE_NOTLAST;
> int slen;
> int len = 0;
>
> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> index 1471ecceabf9..e71aff251ac1 100644
> --- a/net/sunrpc/xprtsock.c
> +++ b/net/sunrpc/xprtsock.c
> @@ -360,8 +360,10 @@ static int xs_send_pagedata(struct socket *sock, struct xdr_buf *xdr, unsigned i
> int flags = XS_SENDMSG_FLAGS;
>
> remainder -= len;
> - if (remainder != 0 || more)
> + if (more)
> flags |= MSG_MORE;
> + if (remainder != 0)
> + flags |= MSG_SENDPAGE_NOTLAST | MSG_MORE;
> err = do_sendpage(sock, *ppage, base, len, flags);
> if (remainder == 0 || err != len)
> break;
> --
> 2.4.3
next prev parent reply other threads:[~2015-10-07 20:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 17:54 [PATCH] SUNRPC: Use MSG_SENDPAGE_NOTLAST when calling sendpage() Trond Myklebust
2015-10-07 20:08 ` Bruce Fields [this message]
2015-10-07 23:17 ` Trond Myklebust
2015-10-08 12:35 ` Trond Myklebust
2015-10-08 13:00 ` Bruce Fields
2015-10-08 13:20 ` [PATCH v2 1/2] SUNRPC: Use MSG_SENDPAGE_NOTLAST in xs_send_pagedata() Trond Myklebust
2015-10-08 13:20 ` [PATCH v2 2/2] SUNRPC: Use MSG_SENDPAGE_NOTLAST in svc_send_common() Trond Myklebust
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=20151007200831.GB27924@fieldses.org \
--to=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
/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