diff mbox series

[rdma-next] lib/irq_poll: support schedules in non-interrupt contexts

Message ID 0141bb9117a653a75a24128dbf4b9d68fbb54e40.1549488381.git.swise@opengridcomputing.com (mailing list archive)
State Mainlined
Commit 4133b013faf31fbab61d4deb626fcb4390042eba
Delegated to: Jason Gunthorpe
Headers show
Series [rdma-next] lib/irq_poll: support schedules in non-interrupt contexts | expand

Commit Message

Steve Wise Feb. 6, 2019, 9:11 p.m. UTC
Do not assume irq_poll_sched() is called from an interrupt context only.
So use raise_softirq_irqoff() instead of __raise_softirq_irqoff() so it
will kick the ksoftirqd if the schedule is from a non-interrupt context.

This is required for RDMA drivers, like soft iwarp, that generate cq
completion notifications in a workqueue or kthread context.  Without this
change, siw completion notifications to the ULP can take several hundred
usecs, depending on the system load.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
 lib/irq_poll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve Wise Feb. 18, 2019, 3:56 p.m. UTC | #1
> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org <linux-rdma-
> owner@vger.kernel.org> On Behalf Of Steve Wise
> Sent: Wednesday, February 6, 2019 3:12 PM
> To: dledford@redhat.com; jgg@mellanox.com
> Cc: linux-rdma@vger.kernel.org; hch@infradead.org; sagi@grimberg.me
> Subject: [PATCH rdma-next] lib/irq_poll: support schedules in
non-interrupt
> contexts
> 
> Do not assume irq_poll_sched() is called from an interrupt context only.
> So use raise_softirq_irqoff() instead of __raise_softirq_irqoff() so it
> will kick the ksoftirqd if the schedule is from a non-interrupt context.
> 
> This is required for RDMA drivers, like soft iwarp, that generate cq
> completion notifications in a workqueue or kthread context.  Without this
> change, siw completion notifications to the ULP can take several hundred
> usecs, depending on the system load.
> 
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  lib/irq_poll.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/irq_poll.c b/lib/irq_poll.c
> index 86a709954f5a..2f17b488d58e 100644
> --- a/lib/irq_poll.c
> +++ b/lib/irq_poll.c
> @@ -35,7 +35,7 @@ void irq_poll_sched(struct irq_poll *iop)
> 
>  	local_irq_save(flags);
>  	list_add_tail(&iop->list, this_cpu_ptr(&blk_cpu_iopoll));
> -	__raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
> +	raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
>  	local_irq_restore(flags);
>  }
>  EXPORT_SYMBOL(irq_poll_sched);
> --
> 1.8.3.1

Are there any comments on this patch?

Thanks,

Steve.
Sagi Grimberg Feb. 19, 2019, 6:22 p.m. UTC | #2
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

Jason, care to pick it up?
Jason Gunthorpe Feb. 19, 2019, 9:07 p.m. UTC | #3
On Wed, Feb 06, 2019 at 01:11:49PM -0800, Steve Wise wrote:
> Do not assume irq_poll_sched() is called from an interrupt context only.
> So use raise_softirq_irqoff() instead of __raise_softirq_irqoff() so it
> will kick the ksoftirqd if the schedule is from a non-interrupt context.
> 
> This is required for RDMA drivers, like soft iwarp, that generate cq
> completion notifications in a workqueue or kthread context.  Without this
> change, siw completion notifications to the ULP can take several hundred
> usecs, depending on the system load.
> 
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> ---
>  lib/irq_poll.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/lib/irq_poll.c b/lib/irq_poll.c
index 86a709954f5a..2f17b488d58e 100644
--- a/lib/irq_poll.c
+++ b/lib/irq_poll.c
@@ -35,7 +35,7 @@  void irq_poll_sched(struct irq_poll *iop)
 
 	local_irq_save(flags);
 	list_add_tail(&iop->list, this_cpu_ptr(&blk_cpu_iopoll));
-	__raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
+	raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
 	local_irq_restore(flags);
 }
 EXPORT_SYMBOL(irq_poll_sched);