Re: [PATCH] blk-mq: setup blk_mq_alloc_data.cmd_flags after submit_bio_checks() is done

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

 



On Fri, Nov 12, 2021 at 09:21:40AM +0100, Christoph Hellwig wrote:
> On Fri, Nov 12, 2021 at 04:11:37PM +0800, Ming Lei wrote:
> > @@ -2564,13 +2564,15 @@ static inline struct request *blk_mq_get_request(struct request_queue *q,
> >  			if (blk_mq_attempt_bio_merge(q, bio, nsegs,
> >  						same_queue_rq))
> >  				return NULL;
> > +			if (bio->bi_opf != rq->cmd_flags)
> > +				goto fallback;
> 
> I think this deserves a comment, as this means a read prealloc

OK.

> can only be used for reads, and no fua can be set if the preallocating
> I/O didn't use fua, etc.
> 
> What are the pitfalls of just chanigng cmd_flags?

Then we need to check cmd_flags carefully, such as hctx->type has to
be same, flush & passthrough flags has to be same, that said all
->cmd_flags used for allocating rqs have to be same with the following
bio->bi_opf.

In usual cases, I guess all IOs submitted from same plug batch should be
same type. If not, we can switch to change cmd_flags.


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