|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [RFC PATCH v4 2/5] ramlist mutex |
Date: | Tue, 23 Aug 2011 13:41:48 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0 |
On 08/23/2011 11:17 AM, Marcelo Tosatti wrote:
> > typedef struct RAMList { > > + QemuMutex mutex; > > uint8_t *phys_dirty; > > QLIST_HEAD(ram, RAMBlock) blocks; > > QLIST_HEAD(, RAMBlock) blocks_mru;> > A comment on what the mutex protects would be good.
Indeed, especially because Umesh wanted to use the ramlist+iothread combo as a rw-lock: iothread = read-lock for the I/O thread, ramlist = read-lock for the migration thread, together = exclusive (write) lock. But I think I talked him out of this. :) It's not a bad idea in general, it just sounds like overkill in this case.
And on the lock ordering.
I think when only two locks are involved, we can always assume iothread is outer and the other is inner. Do you agree?
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |