Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1702436

Re: [PATCH] KVM: avoid using rcu_dereference_protected

From Radim Krčmář <rkrcmar@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] KVM: avoid using rcu_dereference_protected
Date 2017-08-02 22:20 +0200
Message-ID <ua8hD-6jk-81@gated-at.bofh.it> (permalink)
References <ua4dY-3lq-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2017-08-02 17:55+0200, Paolo Bonzini:
> During teardown, accesses to memslots and buses are using
> rcu_dereference_protected with an always-true condition because
> these accesses are done outside the usual mutexes.  This
> is because the last reference is gone and there cannot be any
> concurrent modifications, but rcu_dereference_protected is
> ugly and unobvious.
> 
> Instead, check the refcount in kvm_get_bus and __kvm_memslots.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---

Probably looks nicer than temporarily taking the slots_lock.
Queued for 4.13,

thanks.

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] KVM: avoid using rcu_dereference_protected Paolo Bonzini <pbonzini@redhat.com> - 2017-08-02 18:00 +0200
  Re: [PATCH] KVM: avoid using rcu_dereference_protected Radim Krčmář <rkrcmar@redhat.com> - 2017-08-02 22:20 +0200

csiph-web