Re: [PATCH 2/6] block: allow blk_execute_rq_nowait() to be calledform IRQ context

From: Tejun Heo
Date: Fri Oct 21 2011 - 14:13:45 EST


Hello,

On Fri, Oct 21, 2011 at 05:20:16AM -0400, Christoph Hellwig wrote:
> On Thu, Oct 20, 2011 at 08:56:36PM -0700, Tejun Heo wrote:
> > Currently blk_execute_rq_nowait() directly calls __blk_run_queue() and
> > thus can't be called from IRQ context. This patch updates it to use
> > blk_run_queue_async() instead. This will be used to unexport
> > elv_add_request().
> >
> > This changes how queue is kicked after blk_execute_rq_nowait() but
> > it's hardly a hot path and the effect shouldn't be noticeable.
>
> It actually very much is a fasthpath for many of it's users, e.g. the
> SCSI tape drivers, the OSD layer and the target scsi passthrough
> backend.
>
> I don't think blindly adding a context switch here without benchmarking
> is doable. Just add variants that do the workqueue dance or not.

Hmm... I'd really like to keep that detail inside block layer. How
about something like the following?

Thanks.