From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH RFC 2/2] KVM: thread creating a vcpu is the owner of that vcpu Date: Wed, 03 Dec 2014 13:53:01 +0100 Message-ID: <547F07AD.5010301@redhat.com> References: <1416931449-24585-1-git-send-email-dahi@linux.vnet.ibm.com> <1416931449-24585-3-git-send-email-dahi@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: gleb@kernel.org, jfrei@linux.vnet.ibm.com, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com To: David Hildenbrand , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51345 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbaLCMyO (ORCPT ); Wed, 3 Dec 2014 07:54:14 -0500 In-Reply-To: <1416931449-24585-3-git-send-email-dahi@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 25/11/2014 17:04, David Hildenbrand wrote: > @@ -124,15 +124,6 @@ int vcpu_load(struct kvm_vcpu *vcpu) > > if (mutex_lock_killable(&vcpu->mutex)) > return -EINTR; > - if (unlikely(vcpu->pid != current->pids[PIDTYPE_PID].pid)) { > - /* The thread running this VCPU changed. */ > - struct pid *oldpid = vcpu->pid; > - struct pid *newpid = get_task_pid(current, PIDTYPE_PID); > - rcu_assign_pointer(vcpu->pid, newpid); > - if (oldpid) > - synchronize_rcu(); > - put_pid(oldpid); > - } I think it would make more sense to do this only for the KVM_RUN ioctl. Paolo