SUNRPC: Use TCP_CORK to optimise send performance on the server

Use a counter to keep track of how many requests are queued behind the
xprt->xpt_mutex, and keep TCP_CORK set until the queue is empty.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Link: https://lore.kernel.org/linux-nfs/20210213202532.23146-1-trondmy@kernel.org/T/#u
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
Trond Myklebust 2021-02-16 12:17:22 -05:00 committed by Chuck Lever
parent 0ac24c320c
commit e0a912e8dd
2 changed files with 9 additions and 1 deletions

View file

@ -35,6 +35,8 @@ struct svc_sock {
/* Total length of the data (not including fragment headers)
* received so far in the fragments making up this rpc: */
u32 sk_datalen;
/* Number of queued send requests */
atomic_t sk_sendqlen;
struct page * sk_pages[RPCSVC_MAXPAGES]; /* received data */
};