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.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html