From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rik van Riel Subject: Re: [RFC PATCH 1/3] kvm: keep track of which task is running a KVM vcpu Date: Fri, 03 Dec 2010 09:16:10 -0500 Message-ID: <4CF8FBAA.7000807@redhat.com> References: <20101202144129.4357fe00@annuminas.surriel.com> <20101202144324.4a79263b@annuminas.surriel.com> <20101203121746.GE27994@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Avi Kiviti , Peter Zijlstra , Ingo Molnar , Anthony Liguori To: vatsa@linux.vnet.ibm.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36555 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932117Ab0LCOQf (ORCPT ); Fri, 3 Dec 2010 09:16:35 -0500 In-Reply-To: <20101203121746.GE27994@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/03/2010 07:17 AM, Srivatsa Vaddagiri wrote: > On Thu, Dec 02, 2010 at 02:43:24PM -0500, Rik van Riel wrote: >> mutex_lock(&vcpu->mutex); >> + vcpu->task = current; > > Shouldn't we grab reference to current task_struct before storing a pointer to > it? That should not be needed, since current cannot go away without setting vcpu->task back to NULL in vcpu_put. -- All rights reversed