Re: [PATCH] kvm tools: Process virito blk requests in separate thread

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

 



On Mon, Jun 4, 2012 at 11:48 PM, Cyrill Gorcunov <gorcunov@xxxxxxxxxx> wrote:
> On Mon, Jun 04, 2012 at 11:40:53PM +0800, Asias He wrote:
>>
>> +static void *virtio_blk_thread(void *dev)
>> +{
>> +     struct blk_dev *bdev = dev;
>> +     u64 data;
>> +
>> +     while (1) {
>> +             read(bdev->io_efd, &data, sizeof(u64));
>> +             virtio_blk_do_io(bdev->kvm, &bdev->vqs[0], bdev);
>> +     }
>> +
>> +     pthread_exit(NULL);
>> +     return NULL;
>> +}
>
> I must admit I don't understand this code ;) The data get read into
> stack variable forever?

The data we read itself is not interesting at all. virtio_blk_thread()
sleeps on the eventfd bdev->io_efd until notify_vq() writes something
to wake it up.

-- 
Asias He
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux