]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
SUNRPC: Queue latency-sensitive socket tasks to xprtiod
authorTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 7 Feb 2018 14:13:04 +0000 (09:13 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 7 Feb 2018 14:25:52 +0000 (09:25 -0500)
The response to a write_space notification is very latency sensitive,
so we should queue it to the lower latency xprtiod_workqueue. This
is something we already do for the other cases where an rpc task
holds the transport XPRT_LOCKED bitlock.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
include/linux/sunrpc/sched.h
net/sunrpc/sched.c
net/sunrpc/xprt.c

index d96e74e114c06b18bf022da70f13f02c511faf31..592653becd914a4e9dc3f8fdbea47c2939c706f7 100644 (file)
@@ -229,6 +229,9 @@ void                rpc_sleep_on_priority(struct rpc_wait_queue *,
                                        struct rpc_task *,
                                        rpc_action action,
                                        int priority);
+void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq,
+               struct rpc_wait_queue *queue,
+               struct rpc_task *task);
 void           rpc_wake_up_queued_task(struct rpc_wait_queue *,
                                        struct rpc_task *);
 void           rpc_wake_up(struct rpc_wait_queue *);
index 896691afbb1a805b71a51aa600efa599e784f3c7..96fdf6011c539639bc9368faec6dbaf3ddfa7467 100644 (file)
@@ -458,6 +458,18 @@ static void rpc_wake_up_task_queue_locked(struct rpc_wait_queue *queue, struct r
        rpc_wake_up_task_on_wq_queue_locked(rpciod_workqueue, queue, task);
 }
 
+/*
+ * Wake up a task on a specific queue
+ */
+void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq,
+               struct rpc_wait_queue *queue,
+               struct rpc_task *task)
+{
+       spin_lock_bh(&queue->lock);
+       rpc_wake_up_task_on_wq_queue_locked(wq, queue, task);
+       spin_unlock_bh(&queue->lock);
+}
+
 /*
  * Wake up a task on a specific queue
  */
index 2436fd1125fc608067dcc7a7bc52b9ebb690ae48..8f0ad4f268da58e2380361e72e9adcace18548dd 100644 (file)
@@ -517,7 +517,8 @@ void xprt_write_space(struct rpc_xprt *xprt)
        if (xprt->snd_task) {
                dprintk("RPC:       write space: waking waiting task on "
                                "xprt %p\n", xprt);
-               rpc_wake_up_queued_task(&xprt->pending, xprt->snd_task);
+               rpc_wake_up_queued_task_on_wq(xprtiod_workqueue,
+                               &xprt->pending, xprt->snd_task);
        }
        spin_unlock_bh(&xprt->transport_lock);
 }