[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: |
Paolo Bonzini |
Subject: |
Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize() |
Date: |
Fri, 6 Mar 2020 12:38:42 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 06/03/20 11:20, David Hildenbrand wrote:
> Yeah, rwlocks are not optimal and I am still looking for better
> alternatives (suggestions welcome :) ). Using RCU might not work,
> because the rcu_read region might be too big (esp. while in KVM_RUN).
>
> I had a prototype which used a bunch of atomics + qemu_cond_wait. But it
> was quite elaborate and buggy.
>
> (I assume only going into KVM_RUN is really affected, and I do wonder if
> it will be noticeable at all. Doing an ioctl is always already an
> expensive operation.)
>
> I can look into per-cpu locks instead of the rwlock.
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.
Paolo
- [PATCH RFC 0/4] kvm: Implement atomic memory region resizes, David Hildenbrand, 2020/03/03
- [PATCH RFC 1/4] openpic_kvm: Use kvm_device_ioctl() instead of ioctl(), David Hildenbrand, 2020/03/03
- [PATCH RFC 2/4] intc/s390_flic_kvm.c: Use kvm_device_ioctl() instead of ioctl(), David Hildenbrand, 2020/03/03
- [PATCH RFC 3/4] memory: Add region_resize() callback to memory notifier, David Hildenbrand, 2020/03/03
- [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize(), David Hildenbrand, 2020/03/03
- Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize(), Paolo Bonzini, 2020/03/06
- Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize(), David Hildenbrand, 2020/03/06
- Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize(),
Paolo Bonzini <=
- Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize(), David Hildenbrand, 2020/03/06
- Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize(), David Hildenbrand, 2020/03/06
- Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize(), Paolo Bonzini, 2020/03/06
- Re: [PATCH RFC 4/4] kvm: Implement atomic memory region resizes via region_resize(), David Hildenbrand, 2020/03/06