qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] posix-aio-compat: fix latency issues


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH] posix-aio-compat: fix latency issues
Date: Sat, 13 Aug 2011 20:43:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0

On 08/12/2011 06:24 AM, Anthony Liguori wrote:
On 08/08/2011 06:37 AM, Avi Kivity wrote:

+static void spawn_thread_bh_fn(void *opaque)
+{
+    mutex_lock(&lock);
+    do_spawn_thread();
+    mutex_unlock(&lock);
+}

The locking here is odd. Why not call do_spawn_thread() without the lock, and acquire the lock for the section that needs to hold it?

Just the way the code evolved. Note that aio_thread() does need to take the lock. However, it is indeed cleaner to take the lock when needed rather than drop it when not.


Otherwise, the logic seems correct to me.

Kevin, could you also take a look at this patch?

Yes please.

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]