qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via regi


From: David Hildenbrand
Subject: Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize()
Date: Fri, 6 Mar 2020 15:44:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 06.03.20 15:39, Paolo Bonzini wrote:
> On 06/03/20 15:30, David Hildenbrand wrote:
>>> Assuming we're only talking about CPU ioctls (seems like a good
>>> approximation) maybe you could use start_exclusive/end_exclusive?  The
>>> current_cpu->in_exclusive_context assignments can be made conditional on
>>> "if (current_cpu)".
>>>
>>> However that means you have to drop the BQL, see
>>> process_queued_cpu_work.  It may be a problem.
>>>
>> Yeah, start_exclusive() is expected to be called without the BQL,
>> otherwise the other CPUs would not be able to make progress and can
>> eventually be "caught".
>>
>> It's essentially the same reason why I can't use high-level
>> pause_all_vcpus()/resume_all_vcpus(). Will drop the BQL which is very
>> bad for resizing code.
> 
> But any other synchronization primitive that you do which blocks all
> vCPUs will have the same issue, otherwise you get a deadlock.

This is essentially what this patch solves.

The lock essentially blocks anybody from entering, but not leaving a KVM
ioctl. An inhibitor only waits for all IOCTLs to be left. No other lock
prohibits that, so I don't think there can ever be a deadlock.

-- 
Thanks,

David / dhildenb




reply via email to

[Prev in Thread] Current Thread [Next in Thread]