Skip to content

Commit f1a03b7

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Refactor tasklet scheduling
Restore the separate function that schedules the reply handling tasklet. I need to call it from two different paths. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 467c967 commit f1a03b7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

net/sunrpc/xprtrdma/verbs.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ rpcrdma_run_tasklet(unsigned long data)
106106

107107
static DECLARE_TASKLET(rpcrdma_tasklet_g, rpcrdma_run_tasklet, 0UL);
108108

109+
static void
110+
rpcrdma_schedule_tasklet(struct list_head *sched_list)
111+
{
112+
unsigned long flags;
113+
114+
spin_lock_irqsave(&rpcrdma_tk_lock_g, flags);
115+
list_splice_tail(sched_list, &rpcrdma_tasklets_g);
116+
spin_unlock_irqrestore(&rpcrdma_tk_lock_g, flags);
117+
tasklet_schedule(&rpcrdma_tasklet_g);
118+
}
119+
109120
static void
110121
rpcrdma_qp_async_error_upcall(struct ib_event *event, void *context)
111122
{
@@ -244,7 +255,6 @@ rpcrdma_recvcq_poll(struct ib_cq *cq, struct rpcrdma_ep *ep)
244255
struct list_head sched_list;
245256
struct ib_wc *wcs;
246257
int budget, count, rc;
247-
unsigned long flags;
248258

249259
INIT_LIST_HEAD(&sched_list);
250260
budget = RPCRDMA_WC_BUDGET / RPCRDMA_POLLSIZE;
@@ -262,10 +272,7 @@ rpcrdma_recvcq_poll(struct ib_cq *cq, struct rpcrdma_ep *ep)
262272
rc = 0;
263273

264274
out_schedule:
265-
spin_lock_irqsave(&rpcrdma_tk_lock_g, flags);
266-
list_splice_tail(&sched_list, &rpcrdma_tasklets_g);
267-
spin_unlock_irqrestore(&rpcrdma_tk_lock_g, flags);
268-
tasklet_schedule(&rpcrdma_tasklet_g);
275+
rpcrdma_schedule_tasklet(&sched_list);
269276
return rc;
270277
}
271278

0 commit comments

Comments
 (0)