All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: high CPU load / async IO?
Date: Mon, 24 Jul 2006 13:46:40 -0500	[thread overview]
Message-ID: <pan.2006.07.24.18.46.25.775852@codemonkey.ws> (raw)
In-Reply-To: ea0u9u$gci$1@sea.gmane.org

On Mon, 24 Jul 2006 00:47:21 +0200, Sven Köhler wrote:

> 3) async block I/O (not merged yet)

> It's not in HEAD yet, isn't it?

The pthread-based async patch is a band-aid.  No doubt it helps your
particular case, but it's not the right approach long term.

IDE only supports one outstanding request, so having a thread that runs
the synchronous block routines appears reasonable.  However, SATA and SCSI
both support multiple outstanding requests.  The extension to the existing
patch would be simple--increase the number of threads.

A number of Xen hackers (primarily Andy Warfield and Dan Smith) have been
doing a lot of work analyzing userspace block device performance.  As
QEMU's CPU virtualization gets faster (ala kqemu or VT/SVM), it will start
facing the same bottlenecks that we do today in Xen.

To achieve near-native performance, you basically have to be able to
saturate the host's IO scheduler queue.  Using O_DIRECT, you can do
zero-copy meaning that your ability to queue requests is the only limiting
factor.

What's been discovered is that a thread based approach requires a ton of
threads to achieve saturation.  Just imagine the contention of having a
very large number of threads trying to get at a single BDRVState.

The real solution is to modify the block API to be asynchronous and then
provide support for interacting with the host IO scheduler queue via
something like linux-aio (or the win32 equiv).

So the current thread-based async dma patch is really just the wrong long
term solution.  A more long term solution is likely in the works.  It
requires quite a bit of code modification though.

Regards,

Anthony Liguori 

> Why i'm curious? Well, i'm curious about
the improvement it causes. You
> people once told me, that the boost will not be that significant. On the
> other hand, i see my host CPU usage going towards 100% just because the
> guest is doing some IO or ... or is it because of somethine else
> perhaps?
> 
> To be concrete: have you guys ever run windows-update inside qemu? Well,
> my win2k guest consumes all CPU on the host for some reason. What might
> be the reason?
> (qemu is started with -kernel-kqemu -m 256 -soundhw es1370)
> 
> Also windows-update's green "progress bar" inside the guest is stopping
> for let's say 3 or 5 seconds and not moving continuous.
> 
> Is anybody experiencing the same or knows the reason?
> 
> 
> Thanks,
>   Sven
> _______________________________________________ Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel

  reply	other threads:[~2006-07-24 18:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-23 22:47 [Qemu-devel] high CPU load / async IO? Sven Köhler
2006-07-24 18:46 ` Anthony Liguori [this message]
2006-07-24 22:51   ` [Qemu-devel] " Sven Köhler
2006-07-25 14:55     ` Anthony Liguori
2006-07-25 18:15       ` Sven Köhler
2006-07-25 19:43         ` Jens Axboe
2006-07-25 20:37           ` Fabrice Bellard
2006-07-26  7:45             ` Jens Axboe
2006-07-26 12:21               ` Paul Brook
2006-07-26 12:23                 ` Jens Axboe
2006-07-26 12:27                   ` Paul Brook
2006-07-26 12:46                     ` Jens Axboe
2006-07-26 14:14                       ` Sven Köhler
2006-07-26 17:54                         ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pan.2006.07.24.18.46.25.775852@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.