Avi Kivity e4ea78ee76 posix-aio-compat: fix latency issues
In certain circumstances, posix-aio-compat can incur a lot of latency:
 - threads are created by vcpu threads, so if vcpu affinity is set,
   aio threads inherit vcpu affinity.  This can cause many aio threads
   to compete for one cpu.
 - we can create up to max_threads (64) aio threads in one go; since a
   pthread_create can take around 30μs, we have up to 2ms of cpu time
   under a global lock.

Fix by:
 - moving thread creation to the main thread, so we inherit the main
   thread's affinity instead of the vcpu thread's affinity.
 - if a thread is currently being created, and we need to create yet
   another thread, let thread being born create the new thread, reducing
   the amount of time we spend under the main thread.
 - drop the local lock while creating a thread (we may still hold the
   global mutex, though)

Note this doesn't eliminate latency completely; scheduler artifacts or
lack of host cpu resources can still cause it.  We may want pre-allocated
threads when this cannot be tolerated.

Thanks to Uli Obergfell of Red Hat for his excellent analysis and suggestions.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-08-23 17:41:14 +02:00
2011-08-12 08:31:30 -05:00
2011-06-20 15:13:34 -03:00
2011-08-10 17:34:13 +02:00
2011-08-10 17:34:13 +02:00
2011-08-22 18:26:15 +04:00
2011-04-08 13:03:34 -06:00
2011-05-08 10:09:59 +02:00
2011-06-20 17:08:57 +01:00
2011-07-21 16:48:13 -03:00
2011-08-22 10:20:10 -05:00
2011-08-22 10:17:44 -05:00
2011-08-12 13:07:58 +01:00
2011-03-16 17:11:07 -03:00
2011-06-26 18:25:35 +00:00
2011-08-04 15:51:22 +02:00
2011-07-30 09:41:14 +00:00
2011-06-07 13:52:10 -05:00
2011-08-04 15:51:22 +02:00
2011-08-04 15:51:22 +02:00
2011-06-14 03:08:57 +02:00
2011-08-05 10:57:34 -05:00
2011-08-22 10:20:10 -05:00
2011-08-20 23:01:08 -05:00
2011-07-21 16:48:13 -03:00
2011-07-25 14:38:56 +00:00
2011-08-21 15:33:33 +00:00
2011-08-21 15:33:22 +00:00
2011-08-22 10:17:44 -05:00
2011-08-20 23:01:08 -05:00
2011-08-02 15:53:40 +02:00
2011-08-05 10:57:35 -05:00
2011-08-21 18:27:34 -05:00
2011-03-13 14:44:22 +00:00
2011-07-21 16:48:13 -03:00
2011-08-22 10:20:10 -05:00
2011-07-23 11:26:12 -05:00
2011-07-23 11:57:53 -05:00

Read the documentation in qemu-doc.html.

Fabrice Bellard.
Description
No description provided
Readme 404 MiB
Languages
C 82.6%
C++ 6.5%
Python 3.4%
Dylan 2.9%
Shell 1.6%
Other 2.8%