Re: [PATCH] virtio-blk: Disable callback in virtblk_done()
From: Stefan Hajnoczi <hidden>
Date: 2012-10-02 14:42:58
Also in:
kvm
On Thu, Sep 27, 2012 at 12:01 PM, Paolo Bonzini [off-list ref] wrote:
Il 27/09/2012 02:10, Rusty Russell ha scritto:quoted
quoted
quoted
quoted
quoted
+ do { + virtqueue_disable_cb(vq); + while ((vbr = virtqueue_get_buf(vblk->vq, &len)) != NULL) { + if (vbr->bio) { + virtblk_bio_done(vbr); + bio_done = true; + } else { + virtblk_request_done(vbr); + req_done = true; + } } - } + } while (!virtqueue_enable_cb(vq)); /* In case queue is stopped waiting for more buffers. */ if (req_done) blk_start_queue(vblk->disk->queue);Fascinating. Please just confirm that VIRTIO_RING_F_EVENT_IDX is enabled?Yeah, it's a nice and cheap trick. Stefan, I see that you had this in virtio-scsi since even before I picked it up. Do you remember how you came up with it?
I've played with disable_cb/enable_cb previously in virtio-blk and virtio-scsi when aliguori had suggested reducing notifies. I definitely didn't invent it :). Stefan