Re: [PATCH 3/3] block: Specify the operation type when calling blk_mq_map_queue()

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

 



On Wed, Jun 15, 2022 at 08:08:51AM +0200, Christoph Hellwig wrote:
> On Wed, Jun 15, 2022 at 08:31:21AM +0800, Ming Lei wrote:
> > > -	struct blk_mq_hw_ctx *hctx = blk_mq_map_queue(q, 0, ctx);
> > > +	struct blk_mq_hw_ctx *hctx = blk_mq_map_queue(q, REQ_OP_WRITE, ctx);
> > 
> > The change itself doesn't make a difference, since both results in choosing
> > HCTX_TYPE_DEFAULT, but passing REQ_OP_WRITE is a bit misleading.
> 
> Well, the argument is an operationm so we better pass in a correct
> operation (at some point we should look into a __bitwise annotation
> or similar to make it clean).  And as 0 is REQ_OP_READ, we will end
> up with the HCTX_TYPE_READ hctx IFF someone configures read queues
> and uses an sq only schedule.  Which is a completely stupid but
> possible setup.
> 

OK, looks here the hctx can be retrieved ctx->hctxs[HCTX_TYPE_DEFAULT]
directly.


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