mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
Revert "iothread: release iothread around aio_poll"
This reverts commit a0710f7995
.
In qemu-devel email message <556DBF87.2020908@de.ibm.com>, Christian
Borntraeger writes:
Having many guests all with a kernel/ramdisk (via -kernel) and
several null block devices will result in hangs. All hanging
guests are in partition detection code waiting for an I/O to return
so very early maybe even the first I/O.
Reverting that commit "fixes" the hangs.
Reverting this commit for the 2.4 release. More time is needed to
investigate and correct this patch.
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
d8e3b729cf
commit
da5e1de95b
3 changed files with 24 additions and 14 deletions
|
@ -107,7 +107,6 @@ static void test_notify(void)
|
|||
|
||||
typedef struct {
|
||||
QemuMutex start_lock;
|
||||
EventNotifier notifier;
|
||||
bool thread_acquired;
|
||||
} AcquireTestData;
|
||||
|
||||
|
@ -119,8 +118,6 @@ static void *test_acquire_thread(void *opaque)
|
|||
qemu_mutex_lock(&data->start_lock);
|
||||
qemu_mutex_unlock(&data->start_lock);
|
||||
|
||||
g_usleep(500000);
|
||||
event_notifier_set(&data->notifier);
|
||||
aio_context_acquire(ctx);
|
||||
aio_context_release(ctx);
|
||||
|
||||
|
@ -129,19 +126,20 @@ static void *test_acquire_thread(void *opaque)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void dummy_notifier_read(EventNotifier *n)
|
||||
static void dummy_notifier_read(EventNotifier *unused)
|
||||
{
|
||||
event_notifier_test_and_clear(n);
|
||||
g_assert(false); /* should never be invoked */
|
||||
}
|
||||
|
||||
static void test_acquire(void)
|
||||
{
|
||||
QemuThread thread;
|
||||
EventNotifier notifier;
|
||||
AcquireTestData data;
|
||||
|
||||
/* Dummy event notifier ensures aio_poll() will block */
|
||||
event_notifier_init(&data.notifier, false);
|
||||
aio_set_event_notifier(ctx, &data.notifier, dummy_notifier_read);
|
||||
event_notifier_init(¬ifier, false);
|
||||
aio_set_event_notifier(ctx, ¬ifier, dummy_notifier_read);
|
||||
g_assert(!aio_poll(ctx, false)); /* consume aio_notify() */
|
||||
|
||||
qemu_mutex_init(&data.start_lock);
|
||||
|
@ -155,13 +153,12 @@ static void test_acquire(void)
|
|||
/* Block in aio_poll(), let other thread kick us and acquire context */
|
||||
aio_context_acquire(ctx);
|
||||
qemu_mutex_unlock(&data.start_lock); /* let the thread run */
|
||||
g_assert(aio_poll(ctx, true));
|
||||
g_assert(!data.thread_acquired);
|
||||
g_assert(!aio_poll(ctx, true));
|
||||
aio_context_release(ctx);
|
||||
|
||||
qemu_thread_join(&thread);
|
||||
aio_set_event_notifier(ctx, &data.notifier, NULL);
|
||||
event_notifier_cleanup(&data.notifier);
|
||||
aio_set_event_notifier(ctx, ¬ifier, NULL);
|
||||
event_notifier_cleanup(¬ifier);
|
||||
|
||||
g_assert(data.thread_acquired);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue