[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 13/41] migration: prepare to access s->state out
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 13/41] migration: prepare to access s->state outside critical sections |
Date: |
Thu, 21 Feb 2013 18:46:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
Il 21/02/2013 18:42, Juan Quintela ha scritto:
> Paolo Bonzini <address@hidden> wrote:
>> Accessing s->state outside the big QEMU lock will simplify a bit the
>> locking/unlocking of the iothread lock.
>>
>> Signed-off-by: Paolo Bonzini <address@hidden>
>
> Reviewed-by: Juan Quintela <address@hidden>
>
> We compensate the locking removal you did on the previous patch.
I thought this was thread-safe at any step (and it took a while to reach
that state :)), did I miss something?
>> + __sync_val_compare_and_swap(&s->state, MIG_STATE_ACTIVE,
>> MIG_STATE_ERROR);
>
> This can be done later, but can we change this to a macro/inline
> function:
>
> inline void migration_set_state(int state)
> {
> __sync_val_compare_and_swap(&s->state, MIG_STATE_ACTIVE, state);
> }
>
> or something like that?
Yes, especially so that we can add a tracepoint as in the
recently-posted series.
Paolo
- [Qemu-devel] [PATCH 41/41] migration: inline migrate_fd_close, (continued)
- [Qemu-devel] [PATCH 41/41] migration: inline migrate_fd_close, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 40/41] migration: eliminate s->migration_file, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 17/41] block-migration: document usage of state across threads, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 13/41] migration: prepare to access s->state outside critical sections, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 16/41] block-migration: small preparatory changes for locking, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 19/41] migration: reorder SaveVMHandlers members, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 37/41] migration: small changes around rate-limiting, Paolo Bonzini, 2013/02/15