Re: [RFC PATCH 1/3] kvm: keep track of which task is running a KVMvcpu

From: Avi Kivity
Date: Sun Dec 05 2010 - 08:00:21 EST


On 12/03/2010 04:16 PM, Rik van Riel wrote:
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.


However, you do reference vcpu->task from other contexts. So some sort of safe reference is needed.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/