Skip to contentSkip to conversation

Block I/O optimizations

Qemu-devel Stefan Hajnoczi 6 participants 9 messages Mar 1, 2013 – Apr 4, 2013 9 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CAJSP0QWOzRLi=QPtS8uLR9_c1=M9ptjx+rd8fg2Mnj6tjXAOQA@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): OFB9942FE4.54D170F3-ONC2257B1D.002BE3C8-C2257B1D.00306994@il.ibm.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): OFDEF91A17.56D72381-ONC2257B1D.0061DD03-C2257B1D.00671633@il.ibm.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): OF97530B15.2137222C-ONC2257B1F.004F1393-C2257B1F.0054C2F9@il.ibm.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): OF89B4E81E.00226F20-ONC2257B20.00574B6E-C2257B20.0064B893@il.ibm.com

#9 lore raw
Quoted 10 lines · Abel Gordon

Stefan Hajnoczi <[email protected]> wrote on 28/02/2013 04:43:04 PM:

Quoted 2 lines

I think extending and tuning the existing mechanisms is the way to go. I don't see obvious advantages other than reducing context switches.

Maybe it is worth checking...
We did experiments using vhost-net and vhost-blk. We measured and compared the traditional model (kernel thread per VM/virtual device) to the shared-thread model with fine-grained I/O scheduling (single kernel thread used to serve multiple VMs). We noticed improvements up-to 2.5x in throughput and almost half the latency when running up-to 14 VMs.

Can you post patches?

Also, I wonder if you have time to do a presentation/discussion session so we can get the ball rolling and more people exposed to your approach. There is a weekly QEMU Community Call which we can use as the forum.

The reason I have been skeptical is that prototyping radical changes often involves rewriting or bypassing code. These "accidental" changes can impact performance too. We need to understand where to attribute the performance improvements.

Stefan

#10 lore raw

Stefan Hajnoczi <[email protected]> wrote on 01/03/2013 12:54:54 PM:

Quoted 3 lines · Abel Gordon
Quoted 2 lines

Stefan Hajnoczi <[email protected]> wrote on 28/02/2013 04:43:04 PM:

Quoted 1 line

I think extending and tuning the existing mechanisms is the way to

go.

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

I don't see obvious advantages other than reducing context switches.

Maybe it is worth checking...
We did experiments using vhost-net and vhost-blk. We measured and

compared

Quoted 2 lines
Quoted 2 lines

the traditional model (kernel thread per VM/virtual device) to the shared-thread model with fine-grained I/O scheduling (single kernel

thread

Quoted 4 lines
Quoted 2 lines

used to serve multiple VMs). We noticed improvements up-to 2.5x in throughput and almost half the latency when running up-to 14 VMs.

Can you post patches?

We will publish the code soon but note the patches are for vhost kernel back-end and not for the qemu user-space back-end.

Quoted 3 lines

Also, I wonder if you have time to do a presentation/discussion session so we can get the ball rolling and more people exposed to your approach. There is a weekly QEMU Community Call which we can use as the forum.

Sure. I'll send you a separate email to schedule the presentation/discussion.

#11 lore raw
Quoted 15 lines · Abel Gordon

Stefan Hajnoczi <[email protected]> wrote on 01/03/2013 12:54:54 PM:

Quoted 3 lines · Abel Gordon
Quoted 2 lines

Stefan Hajnoczi <[email protected]> wrote on 28/02/2013 04:43:04 PM:

Quoted 1 line

I think extending and tuning the existing mechanisms is the way to

go.

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

I don't see obvious advantages other than reducing context switches.

Maybe it is worth checking...
We did experiments using vhost-net and vhost-blk. We measured and

compared

Quoted 2 lines
Quoted 2 lines

the traditional model (kernel thread per VM/virtual device) to the shared-thread model with fine-grained I/O scheduling (single kernel

Quoted 8 lines

thread

Quoted 4 lines
Quoted 2 lines

used to serve multiple VMs). We noticed improvements up-to 2.5x in throughput and almost half the latency when running up-to 14 VMs.

Can you post patches?

We will publish the code soon but note the patches are for vhost kernel back-end and not for the qemu user-space back-end.

That's fine. The only difference the codebase makes is which mailing list:

* [email protected] - QEMU userspace
* [email protected] - kvm kernel module
* [email protected] - broader scope Linux
kernel virtualization (vhost, virtio, hyperv drivers, etc)

Stefan

#12 lore raw
In reply to Abel Gordon
Quoted 15 lines · Abel Gordon

Stefan Hajnoczi <[email protected]> wrote on 01/03/2013 12:54:54 PM:

Quoted 3 lines · Abel Gordon
Quoted 2 lines

Stefan Hajnoczi <[email protected]> wrote on 28/02/2013 04:43:04 PM:

Quoted 1 line

I think extending and tuning the existing mechanisms is the way to

go.

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

I don't see obvious advantages other than reducing context switches.

Maybe it is worth checking...
We did experiments using vhost-net and vhost-blk. We measured and

compared

Quoted 2 lines
Quoted 2 lines

the traditional model (kernel thread per VM/virtual device) to the shared-thread model with fine-grained I/O scheduling (single kernel

Quoted 8 lines

thread

Quoted 4 lines
Quoted 2 lines

used to serve multiple VMs). We noticed improvements up-to 2.5x in throughput and almost half the latency when running up-to 14 VMs.

Can you post patches?

We will publish the code soon but note the patches are for vhost kernel back-end and not for the qemu user-space back-end.

Yes, this is one of the fields where the asynchronous interface of vhost could be helpful, abstracting the threading model away from the application.

The main challenge with sharing threads is handling things like cpu limits and swap access. They normally send the current thread to sleep and let another thread run, but if VMs share a thread, this becomes a problem. Could be solvable by detecting such conditions and moving other VMs to per-VM threads, but I haven't seen such patches yet.

Quoted 7 lines
Quoted 3 lines

Also, I wonder if you have time to do a presentation/discussion session so we can get the ball rolling and more people exposed to your approach. There is a weekly QEMU Community Call which we can use as the forum.

Sure. I'll send you a separate email to schedule the presentation/discussion.

#13 lore raw
In reply to Abel Gordon

[email protected] wrote on 03/03/2013 11:35:27 AM:

Quoted 2 lines
Quoted 2 lines

Also, I wonder if you have time to do a presentation/discussion session so we can get the ball rolling and more people exposed to your

approach.

Quoted 4 lines
Quoted 1 line

There is a weekly QEMU Community Call which we can use as the forum.

Sure. I'll send you a separate email to schedule the presentation/discussion.

We just posted a technical report that describes the design and evaluation of the work we did to improve virtual net/block I/O scalability and performance based on vhost and hosting multiple KVM guests. You can find the report here: http://goo.gl/RKppy

(full link:
http://domino.research.ibm.com/library/cyberdig.nsf/1e4115aea78b6e7c85256b360066f0d4/479e3578ed05bfac85257b4200427735!OpenDocument&Highlight=0,h-0319
)

I can present this work in the next QEMU community call.

Regards,
Abel.

#14 lore raw
Quoted 8 lines · Abel Gordon

[email protected] wrote on 03/03/2013 11:35:27 AM:

We just posted a technical report that describes the design and evaluation of the work we did to improve virtual net/block I/O scalability and performance based on vhost and hosting multiple KVM guests. You can find the report here: http://goo.gl/RKppy

Quoted 5 lines

(full link:
http://domino.research.ibm.com/library/cyberdig.nsf/1e4115aea78b6e7c85256b360066f0d4/479e3578ed05bfac85257b4200427735!OpenDocument&Highlight=0,h-0319
)

I can present this work in the next QEMU community call.

That would be great! Thanks Abel.

Regards,

Anthony Liguori

Quoted 3 lines

Regards,
Abel.

#15 lore raw
In reply to Abel Gordon
Quoted 10 lines · Abel Gordon

We just posted a technical report that describes the design and evaluation of the work we did to improve virtual net/block I/O scalability and performance based on vhost and hosting multiple KVM guests. You can find the report here: http://goo.gl/RKppy

(full link:
http://domino.research.ibm.com/library/cyberdig.nsf/1e4115aea78b6e7c85256b360066f0d4/479e3578ed05bfac85257b4200427735!OpenDocument&Highlight=0,h-0319
)

I can present this work in the next QEMU community call.

Hi Abel,

Could you share the presentation to me? I am very interested in your
works and I once have had done some works on vhost_blk. (I can't attend community call)

Thanks,
Yuan

#16 lore raw
In reply to a message not in the archive
Quoted 8 lines · Stefan Hajnoczi
Quoted 3 lines · Loic Dachary

I recently tried to figure out the best and easiest ways to increase block I/O performances with qemu. Not being a qemu expert, I expected to find a few optimization tricks. Much to my surprise, it appears that there are many significant improvements being worked on. This is excellent news :-)

However, I'm not sure I understand how they all fit together. It's probably quite obvious from the developer point of view but I would very much appreciate an overview of how dataplane, vhost-blk, ELVIS etc. should be used or developed to maximize I/O performances. Are there documents I should read ? If not, would someone be willing to share bits of wisdom ?

Hi Loic,
There will be more information on dataplane shortly. I'll write up a blog post and share the link with you.

Hi Loic,
Here is an overview of virtio-blk data plane and how to use it:
http://blog.vmsplice.net/2013/03/new-in-qemu-14-high-performance-virtio.html

Stefan

#17 lore raw

Hi Stefan,

This is excellent ! Thank you very much :-)

Cheers

Quoted 17 lines · Stefan Hajnoczi
Quoted 8 lines · Stefan Hajnoczi
Quoted 3 lines · Loic Dachary

I recently tried to figure out the best and easiest ways to increase block I/O performances with qemu. Not being a qemu expert, I expected to find a few optimization tricks. Much to my surprise, it appears that there are many significant improvements being worked on. This is excellent news :-)

However, I'm not sure I understand how they all fit together. It's probably quite obvious from the developer point of view but I would very much appreciate an overview of how dataplane, vhost-blk, ELVIS etc. should be used or developed to maximize I/O performances. Are there documents I should read ? If not, would someone be willing to share bits of wisdom ?

Hi Loic,
There will be more information on dataplane shortly. I'll write up a blog post and share the link with you.

Hi Loic,
Here is an overview of virtio-blk data plane and how to use it:
http://blog.vmsplice.net/2013/03/new-in-qemu-14-high-performance-virtio.html

Stefan

Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre