qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC][PATCH 11/12] qcow2: Convert qcow2 to use coroutin


From: Avi Kivity
Subject: Re: [Qemu-devel] [RFC][PATCH 11/12] qcow2: Convert qcow2 to use coroutines for async I/O
Date: Thu, 27 Jan 2011 11:25:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7

On 01/26/2011 07:12 PM, Anthony Liguori wrote:
What do you actually save? The longjmp() to the coroutine code, linking in to the mutex wait queue, and another switch back to the main coroutine? Given that we don't expect to block often, it seems hardly a cost worth optimizing.


It's a matter of correctness, not optimization.

Consider the following example:

coroutine {
   l2 = find_l2(offset);
   // allocates but does not increment max cluster offset
   l2[l2_offset(offset)] = alloc_cluster();

   co_mutex_lock(&lock);
   write_l2(l2);
   co_mutex_unlock(&lock);

   l1[l1_offset(offset)] = l2;

   co_mutex_lock(&lock);
   write_l1(l1);
   co_mutex_unlock(&lock);

   commit_cluster(l2[l2_offset(offset)]);
}

This code is incorrect.


Yes it's incorrect, but it isn't what I'm proposing.

--
error compiling committee.c: too many arguments to function




reply via email to

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