From: Eldad Zinger Date: Mon, 2 Aug 2010 12:05:12 +0000 (+0300) Subject: sdp: rx_irq should use tasklet instead of timer due to latency issue X-Git-Tag: v4.1.12-92~264^2~5^2~125 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5118917ea4ae75bac6984ba8ce33397aab016ff5;p=users%2Fjedix%2Flinux-maple.git sdp: rx_irq should use tasklet instead of timer due to latency issue mod_timer(..., 0) measured to add 4ms delay. Signed-off-by: Eldad Zinger --- diff --git a/drivers/infiniband/ulp/sdp/sdp.h b/drivers/infiniband/ulp/sdp/sdp.h index 1cab58c3fc562..2fc4f8f61830b 100644 --- a/drivers/infiniband/ulp/sdp/sdp.h +++ b/drivers/infiniband/ulp/sdp/sdp.h @@ -322,6 +322,7 @@ struct sdp_rx_ring { spinlock_t lock; struct timer_list timer; + struct tasklet_struct tasklet; }; struct sdp_device { diff --git a/drivers/infiniband/ulp/sdp/sdp_rx.c b/drivers/infiniband/ulp/sdp/sdp_rx.c index 8b12cf04e8e66..abe11e4a7dff9 100644 --- a/drivers/infiniband/ulp/sdp/sdp_rx.c +++ b/drivers/infiniband/ulp/sdp/sdp_rx.c @@ -833,7 +833,10 @@ static void sdp_rx_irq(struct ib_cq *cq, void *cq_context) sdp_prf(sk, NULL, "rx irq"); - mod_timer(&ssk->rx_ring.timer, 0); + /* We could use rx_ring.timer instead, but mod_timer(..., 0) + * measured to add 4ms delay. + */ + tasklet_hi_schedule(&ssk->rx_ring.tasklet); } static inline int sdp_should_rearm(struct sock *sk) @@ -969,7 +972,8 @@ int sdp_rx_ring_create(struct sdp_sock *ssk, struct ib_device *device) INIT_WORK(&ssk->rx_comp_work, sdp_rx_comp_work); ssk->rx_ring.timer.function = sdp_process_rx_timer; ssk->rx_ring.timer.data = (unsigned long) ssk; - + tasklet_init(&ssk->rx_ring.tasklet, sdp_process_rx_timer, + (unsigned long) ssk); sdp_arm_rx_cq(&ssk->isk.sk); return 0; @@ -1000,10 +1004,11 @@ void sdp_rx_ring_destroy(struct sdp_sock *ssk) } } - /* the timer should be deleted only after the rx_cq is destroyed, - * so there won't be rx_irq any more, meaning the timer will never be + /* the tasklet should be killed only after the rx_cq is destroyed, + * so there won't be rx_irq any more, meaning the tasklet will never be * enabled. */ del_timer_sync(&ssk->rx_ring.timer); + tasklet_kill(&ssk->rx_ring.tasklet); SDP_WARN_ON(ring_head(ssk->rx_ring) != ring_tail(ssk->rx_ring)); }