On 09/22/2009 03:44 PM, Marcelo Tosatti wrote:

I think you can use rcu for this as well.  When you read the log,
allocate a new empty bitmap, switch the memslots pointer to include it,
and synchronize_srcu().  Now we are certain everyone is using the new
bitmap we can copy the old one to usespace and delete it.
This will slow down get_dirty_log, which can lead to regressions in
migration and poorer vga refresh updates.

That's true. By how much? srcu is not so slow that a 30Hz refresh rate would notice.

Moreover, since updates are running concurrently, at the time
synchronize_srcu returns you can have plenty of dirty data in the new
bitmap which is not the case with mutual exclusion.

By the time ioctl() returns you can have dirty data in the new bitmap. Nothing wrong with that.

This are the reasons for the choice. Would you prefer a new rw lock?

Prefer the srcu thing unless convinced it is too slow. Alternatively, we can copy-and-clear the bitmap using cmpxchg (which won't lose data) to a temporary buffer, then to userspace. Locks are unfashionable.

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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to