diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2018-09-09 13:53:05 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2018-09-30 15:35:16 -0400 |
commit | 79c99152a374c72c8b90c27b3d46d990641951bb (patch) | |
tree | 80b106169e9f4b997c83c357b7e4c04add9938c1 | |
parent | f42f7c283078ce3c1e8368b140e270755b1ae313 (diff) |
SUNRPC: Convert the xprt->sending queue back to an ordinary wait queue
We no longer need priority semantics on the xprt->sending queue, because
the order in which tasks are sent is now dictated by their position in
the send queue.
Note that the backlog queue remains a priority queue, meaning that
slot resources are still managed in order of task priority.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
-rw-r--r-- | net/sunrpc/xprt.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 480461ad0c86..7333874c6595 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -192,7 +192,6 @@ static void xprt_clear_locked(struct rpc_xprt *xprt) | |||
192 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task) | 192 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task) |
193 | { | 193 | { |
194 | struct rpc_rqst *req = task->tk_rqstp; | 194 | struct rpc_rqst *req = task->tk_rqstp; |
195 | int priority; | ||
196 | 195 | ||
197 | if (test_and_set_bit(XPRT_LOCKED, &xprt->state)) { | 196 | if (test_and_set_bit(XPRT_LOCKED, &xprt->state)) { |
198 | if (task == xprt->snd_task) | 197 | if (task == xprt->snd_task) |
@@ -212,13 +211,7 @@ out_sleep: | |||
212 | task->tk_pid, xprt); | 211 | task->tk_pid, xprt); |
213 | task->tk_timeout = RPC_IS_SOFT(task) ? req->rq_timeout : 0; | 212 | task->tk_timeout = RPC_IS_SOFT(task) ? req->rq_timeout : 0; |
214 | task->tk_status = -EAGAIN; | 213 | task->tk_status = -EAGAIN; |
215 | if (req == NULL) | 214 | rpc_sleep_on(&xprt->sending, task, NULL); |
216 | priority = RPC_PRIORITY_LOW; | ||
217 | else if (!req->rq_ntrans) | ||
218 | priority = RPC_PRIORITY_NORMAL; | ||
219 | else | ||
220 | priority = RPC_PRIORITY_HIGH; | ||
221 | rpc_sleep_on_priority(&xprt->sending, task, NULL, priority); | ||
222 | return 0; | 215 | return 0; |
223 | } | 216 | } |
224 | EXPORT_SYMBOL_GPL(xprt_reserve_xprt); | 217 | EXPORT_SYMBOL_GPL(xprt_reserve_xprt); |
@@ -260,7 +253,6 @@ xprt_test_and_clear_congestion_window_wait(struct rpc_xprt *xprt) | |||
260 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task) | 253 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task) |
261 | { | 254 | { |
262 | struct rpc_rqst *req = task->tk_rqstp; | 255 | struct rpc_rqst *req = task->tk_rqstp; |
263 | int priority; | ||
264 | 256 | ||
265 | if (test_and_set_bit(XPRT_LOCKED, &xprt->state)) { | 257 | if (test_and_set_bit(XPRT_LOCKED, &xprt->state)) { |
266 | if (task == xprt->snd_task) | 258 | if (task == xprt->snd_task) |
@@ -283,13 +275,7 @@ out_sleep: | |||
283 | dprintk("RPC: %5u failed to lock transport %p\n", task->tk_pid, xprt); | 275 | dprintk("RPC: %5u failed to lock transport %p\n", task->tk_pid, xprt); |
284 | task->tk_timeout = RPC_IS_SOFT(task) ? req->rq_timeout : 0; | 276 | task->tk_timeout = RPC_IS_SOFT(task) ? req->rq_timeout : 0; |
285 | task->tk_status = -EAGAIN; | 277 | task->tk_status = -EAGAIN; |
286 | if (req == NULL) | 278 | rpc_sleep_on(&xprt->sending, task, NULL); |
287 | priority = RPC_PRIORITY_LOW; | ||
288 | else if (!req->rq_ntrans) | ||
289 | priority = RPC_PRIORITY_NORMAL; | ||
290 | else | ||
291 | priority = RPC_PRIORITY_HIGH; | ||
292 | rpc_sleep_on_priority(&xprt->sending, task, NULL, priority); | ||
293 | return 0; | 279 | return 0; |
294 | } | 280 | } |
295 | EXPORT_SYMBOL_GPL(xprt_reserve_xprt_cong); | 281 | EXPORT_SYMBOL_GPL(xprt_reserve_xprt_cong); |
@@ -1796,7 +1782,7 @@ static void xprt_init(struct rpc_xprt *xprt, struct net *net) | |||
1796 | 1782 | ||
1797 | rpc_init_wait_queue(&xprt->binding, "xprt_binding"); | 1783 | rpc_init_wait_queue(&xprt->binding, "xprt_binding"); |
1798 | rpc_init_wait_queue(&xprt->pending, "xprt_pending"); | 1784 | rpc_init_wait_queue(&xprt->pending, "xprt_pending"); |
1799 | rpc_init_priority_wait_queue(&xprt->sending, "xprt_sending"); | 1785 | rpc_init_wait_queue(&xprt->sending, "xprt_sending"); |
1800 | rpc_init_priority_wait_queue(&xprt->backlog, "xprt_backlog"); | 1786 | rpc_init_priority_wait_queue(&xprt->backlog, "xprt_backlog"); |
1801 | 1787 | ||
1802 | xprt_init_xid(xprt); | 1788 | xprt_init_xid(xprt); |