From: Umesh Deshpande <udeshpan@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: mtosatti@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org,
quintela@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH v4 2/5] ramlist mutex
Date: Fri, 19 Aug 2011 02:20:33 -0400 [thread overview]
Message-ID: <4E4E00B1.9050009@redhat.com> (raw)
In-Reply-To: <4E4B5FA8.4020006@redhat.com>
On 08/17/2011 02:28 AM, Paolo Bonzini wrote:
> On 08/16/2011 08:56 PM, Umesh Deshpande wrote:
>> @@ -3001,8 +3016,10 @@ void qemu_ram_free_from_ptr(ram_addr_t addr)
>>
>> QLIST_FOREACH(block,&ram_list.blocks, next) {
>> if (addr == block->offset) {
>> + qemu_mutex_lock_ramlist();
>> QLIST_REMOVE(block, next);
>> QLIST_REMOVE(block, next_mru);
>> + qemu_mutex_unlock_ramlist();
>> qemu_free(block);
>> return;
>> }
>> @@ -3015,8 +3032,10 @@ void qemu_ram_free(ram_addr_t addr)
>>
>> QLIST_FOREACH(block,&ram_list.blocks, next) {
>> if (addr == block->offset) {
>> + qemu_mutex_lock_ramlist();
>> QLIST_REMOVE(block, next);
>> QLIST_REMOVE(block, next_mru);
>> + qemu_mutex_unlock_ramlist();
>> if (block->flags& RAM_PREALLOC_MASK) {
>> ;
>> } else if (mem_path) {
>
> You must protect the whole QLIST_FOREACH. Otherwise looks good.
Or, is it okay to convert all the ramblock list traversals in exec.c
(under iothread) to mru traversals, and probably it makes sense as the
original list was also maintained in the mru order, whereas the sequence
of blocks doesn't matter for the migration code. This way we don't have
to acquire the mutex for block list traversals.
- Umesh
next prev parent reply other threads:[~2011-08-19 6:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-17 3:56 [Qemu-devel] [RFC PATCH v4 0/5] Separate thread for VM migration Umesh Deshpande
2011-08-17 3:56 ` [Qemu-devel] [RFC PATCH v4 1/5] MRU ram list Umesh Deshpande
2011-08-17 3:56 ` [Qemu-devel] [RFC PATCH v4 2/5] ramlist mutex Umesh Deshpande
2011-08-17 6:28 ` Paolo Bonzini
2011-08-19 6:20 ` Umesh Deshpande [this message]
2011-08-22 6:48 ` Paolo Bonzini
2011-08-23 9:15 ` Marcelo Tosatti
2011-08-23 9:17 ` Marcelo Tosatti
2011-08-23 11:41 ` Paolo Bonzini
2011-08-23 12:16 ` Marcelo Tosatti
2011-08-17 3:56 ` [Qemu-devel] [RFC PATCH v4 3/5] separate migration bitmap Umesh Deshpande
2011-08-17 3:56 ` [Qemu-devel] [RFC PATCH v4 4/5] separate thread for VM migration Umesh Deshpande
2011-08-17 7:13 ` Paolo Bonzini
2011-08-17 3:56 ` [Qemu-devel] [RFC PATCH v3 5/5] Making iothread block for migrate_cancel Umesh Deshpande
2011-08-17 7:14 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E4E00B1.9050009@redhat.com \
--to=udeshpan@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).