On Wed, May 21, 2008 at 10:59:28AM -0400, Daniel Veillard wrote:
On Fri, May 16, 2008 at 10:47:40PM +0100, Daniel P. Berrange wrote:
> KVM added ability to get the thread ID for vCPUs via the monitor
>
> (qemu) info cpus
> * CPU #0: pc=0x00000000000ffff0 thread_id=11463
> CPU #1: pc=0x00000000fffffff0 thread_id=11464
> CPU #2: pc=0x00000000fffffff0 thread_id=11465
>
> With this we have enough information to be able to support vCPU pinning in
> the QEMU driver for KVM. For QEMU/KQEMU it is trivial, since they have a
> single thread.
>
> The following patch implements CPU pinning and fetching of CPU affinity
> information. In this example I pin one of the 2 cpus in a guest:
[...]
> This is implemented using sched_setaffinity/sched_getaffinity which are
> Linux specific. There doesn't appear to be a portable process affinity
> API in POSIX.
looks fine to me. I guess the main use will be for KVM which is Linux
specific, so that should not be a big deal IMHO (if we could just make sure
the code doesn't bomb at compile time on say Solaris).
Ok, when I comited this I made it conditional on presence of the
sched_getaffinity/sched.h function & include, as detected by configure.in
So it should automatically disable itself on Solaris
Regards,
Daniel
--
|: Red Hat, Engineering, Boston -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://ovirt.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|