Re: [PATCH] blk-mq: don't queue passthrough request into scheduler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 12, 2023 at 01:20:15PM -0700, Christoph Hellwig wrote:
> On Fri, May 12, 2023 at 09:08:54AM -0600, Jens Axboe wrote:
> > On 5/12/23 9:03?AM, Ming Lei wrote:
> > > Passthrough(pt) request shouldn't be queued to scheduler, especially some
> > > schedulers(such as bfq) supposes that req->bio is always available and
> > > blk-cgroup can be retrieved via bio.
> > > 
> > > Sometimes pt request could be part of error handling, so it is better to always
> > > queue it into hctx->dispatch directly.
> > > 
> > > Fix this issue by queuing pt request from plug list to hctx->dispatch
> > > directly.
> > 
> > Why not just add the check to the BFQ insertion? That would be a lot
> > more trivial and would not be poluting the core with this stuff.
> 
> Because we really need to keep the passthrough code separate.  The
> fact that a passthrough request can leak into common code in various
> places is really a bit of a problem.  We have most of these nicely
> separate with two exceptions:
> 
>  - the plug list
>  - the requeue list
> 
> The higher level and the more obvious we special case the passthrough
> request there, the better for debuggability and maintainability.

Agree, and there could be more things involved:

1) pt request shares same tags, so scheduler tags is used for allocating pt
request

2) RQF_ELV is set for pt request, and e->type->ops.requeue_request()/
e->type->ops.completed_request() still might be called for pt request.

Probably long-term one dedicated request queue(BLK_MQ_F_TAG_QUEUE_SHARED/
BLK_MQ_F_NO_SCHED) could be used for handling passthrough only if the device
exposes pt interface. Then I guess core code may be cleaned a bit and
becomes easier to improve both two paths, but plug handling still have
to cover both.


thanks,
Ming




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux