Re: [PATCH 2/3] KVM: Centralize slots_lock aquisition during KVM_CREATE_IRQCHIP

Takuya Yoshikawa
2010-12-16T09:44:41Z

(2010/12/16 18:34), Avi Kivity wrote:
>>> Maybe we ought to move slots_lock acquisition to kvm_io_bus_register() and friends.
>>>
>>
>>
>> So it will move the lock acquisition to the opposite ( callee ) side than mine.
>> At first, I tried to do that, but there are so many ...
>>
>> Anyway, your suggestion seems to be the best way if possible.
>>
>>
>> One question: how about kvm_io_bus_[read|write] ?
>>
>> These are called from the emulator but I could not find where slots_lock
>> are held though I can see the comments
>>
>> "kvm_io_bus_[read|write] - called under kvm->slots_lock"
>>
>
> They're under srcu now, the comments are outdated.
>
> We used to have slots_lock be a rwsem, taken for read or write as necessary. Now we use srcu for read, and the slots_lock mutex + synchronize_srcu for write.
>

Ah, would you mind updating the comments?
- or just removing outdated ones?

I will reread these locking based on your answer!

Thanks,
Takuya