Commit e387819a authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] Do RPC over TCP reply message delivery in sock->data_ready()

xprt.c:
  Speed up synchronous RPC over TCP calls by having the
  replies delivered by the IPV4 "bottom half", instead of
  switching to the rpciod process in order to call recvmsg().
   - Remove sock_recvmsg() interface.
   - Remove rpc_xprt_pending list and rpciod_tcp_dispatcher() interface.
   - Use the new tcp_read_sock() interface to deliver data directly
     from within tcp_data_ready().
sched.c:
   - Remove references to rpciod_tcp_dispatcher.
xprt.h:
   - New set of flags to reflect the TCP record read state.

Cheers,
  Trond
parent d755a07e
...@@ -120,6 +120,11 @@ struct rpc_rqst { ...@@ -120,6 +120,11 @@ struct rpc_rqst {
#define rq_rnr rq_rcv_buf.io_nr #define rq_rnr rq_rcv_buf.io_nr
#define rq_rlen rq_rcv_buf.io_len #define rq_rlen rq_rcv_buf.io_len
#define XPRT_LAST_FRAG (1 << 0)
#define XPRT_COPY_RECM (1 << 1)
#define XPRT_COPY_XID (1 << 2)
#define XPRT_COPY_DATA (1 << 3)
struct rpc_xprt { struct rpc_xprt {
struct socket * sock; /* BSD socket layer */ struct socket * sock; /* BSD socket layer */
struct sock * inet; /* INET layer */ struct sock * inet; /* INET layer */
...@@ -140,18 +145,17 @@ struct rpc_xprt { ...@@ -140,18 +145,17 @@ struct rpc_xprt {
unsigned long sockstate; /* Socket state */ unsigned long sockstate; /* Socket state */
unsigned char shutdown : 1, /* being shut down */ unsigned char shutdown : 1, /* being shut down */
nocong : 1, /* no congestion control */ nocong : 1, /* no congestion control */
stream : 1, /* TCP */ stream : 1; /* TCP */
tcp_more : 1; /* more record fragments */
/* /*
* State of TCP reply receive stuff * State of TCP reply receive stuff
*/ */
u32 tcp_recm; /* Fragment header */ u32 tcp_recm, /* Fragment header */
u32 tcp_xid; /* Current XID */ tcp_xid, /* Current XID */
unsigned int tcp_reclen, /* fragment length */ tcp_reclen, /* fragment length */
tcp_offset, /* fragment offset */ tcp_offset; /* fragment offset */
tcp_copied; /* copied to request */ unsigned long tcp_copied, /* copied to request */
struct list_head rx_pending; /* receive pending list */ tcp_flags;
/* /*
* Send stuff * Send stuff
...@@ -185,8 +189,6 @@ int xprt_adjust_timeout(struct rpc_timeout *); ...@@ -185,8 +189,6 @@ int xprt_adjust_timeout(struct rpc_timeout *);
void xprt_release(struct rpc_task *); void xprt_release(struct rpc_task *);
void xprt_reconnect(struct rpc_task *); void xprt_reconnect(struct rpc_task *);
int xprt_clear_backlog(struct rpc_xprt *); int xprt_clear_backlog(struct rpc_xprt *);
int xprt_tcp_pending(void);
void __rpciod_tcp_dispatcher(void);
#define XPRT_WSPACE 0 #define XPRT_WSPACE 0
#define XPRT_CONNECT 1 #define XPRT_CONNECT 1
...@@ -200,13 +202,6 @@ void __rpciod_tcp_dispatcher(void); ...@@ -200,13 +202,6 @@ void __rpciod_tcp_dispatcher(void);
#define xprt_test_and_set_connected(xp) (test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate)) #define xprt_test_and_set_connected(xp) (test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate))
#define xprt_clear_connected(xp) (clear_bit(XPRT_CONNECT, &(xp)->sockstate)) #define xprt_clear_connected(xp) (clear_bit(XPRT_CONNECT, &(xp)->sockstate))
static inline
void rpciod_tcp_dispatcher(void)
{
if (xprt_tcp_pending())
__rpciod_tcp_dispatcher();
}
#endif /* __KERNEL__*/ #endif /* __KERNEL__*/
#endif /* _LINUX_SUNRPC_XPRT_H */ #endif /* _LINUX_SUNRPC_XPRT_H */
...@@ -704,9 +704,6 @@ __rpc_schedule(void) ...@@ -704,9 +704,6 @@ __rpc_schedule(void)
dprintk("RPC: rpc_schedule enter\n"); dprintk("RPC: rpc_schedule enter\n");
while (1) { while (1) {
/* Ensure equal rights for tcp tasks... */
rpciod_tcp_dispatcher();
spin_lock_bh(&rpc_queue_lock); spin_lock_bh(&rpc_queue_lock);
task_for_first(task, &schedq.tasks) { task_for_first(task, &schedq.tasks) {
...@@ -1030,7 +1027,7 @@ static DECLARE_MUTEX_LOCKED(rpciod_running); ...@@ -1030,7 +1027,7 @@ static DECLARE_MUTEX_LOCKED(rpciod_running);
static inline int static inline int
rpciod_task_pending(void) rpciod_task_pending(void)
{ {
return !list_empty(&schedq.tasks) || xprt_tcp_pending(); return !list_empty(&schedq.tasks);
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment