[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object w
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM |
Date: |
Tue, 08 Aug 2017 15:01:10 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Wed 02 Aug 2017 12:57:04 PM CEST, Manos Pitsidianakis wrote:
>> At the moment I think throttle_groups_lock isn't strictly needed
>> because incref/decref callers hold the QEMU global mutex anyway.
>>
>> But code accessing throttle_groups still has to be disciplined.
>> Since throttle_groups_lock exists, please use it consistently in all
>> code paths.
>>
>> Alternatively you could remove the lock and document that
>> throttle_groups is protected by the global mutex. What we can't do
>> is sometimes use throttle_groups_lock and sometimes not use it.
>
> If we use throttle_groups_lock in throttle_group_obj_init() then we
> must give it up in throttle_group_incref() and retake it in
> throttle_group_obj_init(). Maybe indeed it's better to drop
> throttle_groups_lock altogether, since the ThrottleGroup refcounting
> always happens in a QMP or startup/cleanup context.
I checked the code and I also don't see any manipulation of the group
list outside the global mutex, so you can remove throttle_groups_lock,
but please document very clearly that all these calls can only happen
when they are protected by the global mutex.
Berto
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM, Stefan Hajnoczi, 2017/08/01
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM, Manos Pitsidianakis, 2017/08/01
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM, Stefan Hajnoczi, 2017/08/02
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM, Manos Pitsidianakis, 2017/08/02
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM, Stefan Hajnoczi, 2017/08/02
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM, Kevin Wolf, 2017/08/03
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM, Stefan Hajnoczi, 2017/08/03
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM, Kevin Wolf, 2017/08/03
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM, Manos Pitsidianakis, 2017/08/03
- Re: [Qemu-devel] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM,
Alberto Garcia <=