Re: [PATCH 03/13] irq_poll: fold irq_poll_sched_prep into irq_poll_sched

From: Bart Van Assche
Date: Tue Dec 29 2015 - 04:54:37 EST


On 12/07/2015 09:51 PM, Christoph Hellwig wrote:
diff --git a/lib/irq_poll.c b/lib/irq_poll.c
index 88af879..13cb149 100644
--- a/lib/irq_poll.c
+++ b/lib/irq_poll.c
@@ -21,13 +21,17 @@ static DEFINE_PER_CPU(struct list_head, blk_cpu_iopoll);
*
* Description:
* Add this irq_poll structure to the pending poll list and trigger the
- * raise of the blk iopoll softirq. The driver must already have gotten a
- * successful return from irq_poll_sched_prep() before calling this.
+ * raise of the blk iopoll softirq.
**/
void irq_poll_sched(struct irq_poll *iop)
{
unsigned long flags;

+ if (test_bit(IRQ_POLL_F_DISABLE, &iop->state))
+ return;
+ if (!test_and_set_bit(IRQ_POLL_F_SCHED, &iop->state))
+ return;
+
local_irq_save(flags);
list_add_tail(&iop->list, this_cpu_ptr(&blk_cpu_iopoll));
__raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);

After having applied these changes the SRP initiator didn't receive any RDMA completions anymore. I could remedy that by changing "!test_and_set_bit()" into "test_and_set_bit()":

diff --git a/lib/irq_poll.c b/lib/irq_poll.c
index 43a3370..3a67019 100644
--- a/lib/irq_poll.c
+++ b/lib/irq_poll.c
@@ -29,7 +29,7 @@ void irq_poll_sched(struct irq_poll *iop)

if (test_bit(IRQ_POLL_F_DISABLE, &iop->state))
return;
- if (!test_and_set_bit(IRQ_POLL_F_SCHED, &iop->state))
+ if (test_and_set_bit(IRQ_POLL_F_SCHED, &iop->state))
return;

local_irq_save(flags);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/