Skip to content

Commit 2275cde

Browse files
committed
SUNRPC: Queue latency-sensitive socket tasks to xprtiod
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 <[email protected]>
1 parent 0c8cbcd commit 2275cde

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

include/linux/sunrpc/sched.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ void rpc_sleep_on_priority(struct rpc_wait_queue *,
229229
struct rpc_task *,
230230
rpc_action action,
231231
int priority);
232+
void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq,
233+
struct rpc_wait_queue *queue,
234+
struct rpc_task *task);
232235
void rpc_wake_up_queued_task(struct rpc_wait_queue *,
233236
struct rpc_task *);
234237
void rpc_wake_up(struct rpc_wait_queue *);

net/sunrpc/sched.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,18 @@ static void rpc_wake_up_task_queue_locked(struct rpc_wait_queue *queue, struct r
458458
rpc_wake_up_task_on_wq_queue_locked(rpciod_workqueue, queue, task);
459459
}
460460

461+
/*
462+
* Wake up a task on a specific queue
463+
*/
464+
void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq,
465+
struct rpc_wait_queue *queue,
466+
struct rpc_task *task)
467+
{
468+
spin_lock_bh(&queue->lock);
469+
rpc_wake_up_task_on_wq_queue_locked(wq, queue, task);
470+
spin_unlock_bh(&queue->lock);
471+
}
472+
461473
/*
462474
* Wake up a task on a specific queue
463475
*/

net/sunrpc/xprt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,8 @@ void xprt_write_space(struct rpc_xprt *xprt)
517517
if (xprt->snd_task) {
518518
dprintk("RPC: write space: waking waiting task on "
519519
"xprt %p\n", xprt);
520-
rpc_wake_up_queued_task(&xprt->pending, xprt->snd_task);
520+
rpc_wake_up_queued_task_on_wq(xprtiod_workqueue,
521+
&xprt->pending, xprt->snd_task);
521522
}
522523
spin_unlock_bh(&xprt->transport_lock);
523524
}

0 commit comments

Comments
 (0)