Re: [PATCH v3 1/2] virtio-blk: support polling I/O

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

 



On Mon, Mar 28, 2022 at 01:53:46PM +0100, Stefan Hajnoczi wrote:
> On Thu, Mar 24, 2022 at 11:04:49PM +0900, Suwan Kim wrote:
> > +static int virtblk_poll(struct blk_mq_hw_ctx *hctx, struct io_comp_batch *iob)
> > +{
> > +	struct virtio_blk_vq *vq = hctx->driver_data;
> > +	struct virtblk_req *vbr;
> > +	unsigned long flags;
> > +	unsigned int len;
> > +	int found = 0;
> > +
> > +	spin_lock_irqsave(&vq->lock, flags);
> > +
> > +	while ((vbr = virtqueue_get_buf(vq->vq, &len)) != NULL) {
> > +		struct request *req = blk_mq_rq_from_pdu(vbr);
> > +
> > +		found++;
> > +		if (!blk_mq_add_to_batch(req, iob, vbr->status,
> > +						virtblk_complete_batch))
> > +			blk_mq_complete_request(req);
> > +	}
> > +
> > +	spin_unlock_irqrestore(&vq->lock, flags);
> 
> virtblk_done() does:
> 
>   /* In case queue is stopped waiting for more buffers. */
>   if (req_done)
>           blk_mq_start_stopped_hw_queues(vblk->disk->queue, true);
> 
> Is the same thing needed here in virtblk_poll() so that stopped queues
> are restarted when requests complete?

I think you are right. I missed that.

I just added blk_mq_start_stopped_hw_queues() to virtblk_poll as
you commented and did performance test again.

It showed higher peak performance than virtblk_poll without
blk_mq_start_stopped_hw_queues().

I will add it in next version.
Thanks for the comment!

Regards,
Suwan Kim



[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