Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1298160

Re: [PATCH] null_blk: don't enable irqs when in irq

From Jens Axboe <axboe@fb.com>
Newsgroups linux.kernel
Subject Re: [PATCH] null_blk: don't enable irqs when in irq
Date 2015-12-26 05:10 +0100
Message-ID <qJOl4-4um-15@gated-at.bofh.it> (permalink)
References <qJBxv-4CL-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/25/2015 07:26 AM, Rabin Vincent wrote:
> When using irq_mode=NULL_IRQ_TIMER, blk_start_queue() is called from the
> hrtimer interrupt.  null_request_fn() calls spin_unlock_irq() and this
> causes the following splat from lockdep since interrupts are being
> enabled while we're in an interrupt handler.
>
> When we're in null_request_fn() we can't know the status of the flags
> saved before blk_start_queue() was called, but we can use in_irq() to
> conditionally enable interrupts only if we're not in a hard interrupt in
> order to handle this case.

Using in_irq() to check for this is... nasty. You have two choices here. 
Either you don't enable interrupts ever. That's safe from the 
perspective of the driver, since we don't block in handling the command. 
That means just unconditionally using spin_unlock() in the request_fn. 
Or you punt queue running to process context, by manually clearing the 
queue stopped flag and using blk_run_queue_async() instead.

-- 
Jens Axboe

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] null_blk: don't enable irqs when in irq Rabin Vincent <rabin@rab.in> - 2015-12-25 15:30 +0100
  Re: [PATCH] null_blk: don't enable irqs when in irq Jens Axboe <axboe@fb.com> - 2015-12-26 05:10 +0100
    Re: [PATCH] null_blk: don't enable irqs when in irq Jens Axboe <axboe@fb.com> - 2015-12-28 20:00 +0100
      Re: [PATCH] null_blk: don't enable irqs when in irq Rabin Vincent <rabin@rab.in> - 2015-12-28 20:10 +0100
        Re: [PATCH] null_blk: don't enable irqs when in irq Jens Axboe <axboe@fb.com> - 2015-12-28 20:20 +0100
          Re: [PATCH] null_blk: don't enable irqs when in irq Rabin Vincent <rabin@rab.in> - 2015-12-28 21:00 +0100
            Re: [PATCH] null_blk: don't enable irqs when in irq Jens Axboe <axboe@fb.com> - 2015-12-28 21:20 +0100

csiph-web