Re: [PATCH 0/8] RFC: vcpu pinning at qemu start

Anthony Liguori
2008-03-05T03:43:40Z

Glauber Costa wrote:
> Anthony Liguori wrote:
>
> No, it can't. Because at the time qemu starts, no vcpu -> thread id
> relationship exists at all. And we don't know when it will.

Sure we do. The vcpu -> thread id relationship is valid after
kvm_init_ap() is called which is after machine init but before the
select loop is entered for the first time. Therefore, if you start qemu
with -S, then connect on the monitor, and do an info cpus, you could be
guaranteed to be told the mapping.

The threads are *idle* at this point so there's no harm if they were
started on the "wrong" CPU. You can now taskset to your hearts content
and then when you're happy with placement, you can issue a 'cont' so
that the VM actually starts running. I saw "wrong" because you can
still taskset the initial creation guaranteeing that the threads are
created on the right group of physical CPUs, you just can't specify the
exact mapping until you start interacting with the monitor.

Regards,

Anthony Liguori

>> Regards,
>>
>> Anthony Liguori
>>
>>>
>>>
>>