On Fri, 8 Aug 2008 21:51:33 +0300
Kostik Belousov <[EMAIL PROTECTED]> mentioned:

> > 
> > You can achieve that now with cpuset. :)  (See my ping-pong test program 
> > recently which used cpuid to fetch the APIC ID to test for ping-ponging in 
> > the scheduler.)
> 
> If this is a backout request (for cpuid functionality) then we will do it.
> 
> But I considered it much easier and cleaner to do
>       fd = open("/dev/cpuctlN", O_RDWR);
>       ioctl(fd, CPUCTL_CPUID, &x);
>       if (x.y)
>               ioctl(fd, CPUCTL_WRMSR, ...);
>       close(fd);
> then
>       fd = open("/dev/cpuctlN", O_RDWR);
>       cpuset(...); /* bind to cpu */
>       __asm__("cpuid" : =0 (x));
>       if (x.y)
>               ioctl(fd, CPUCTL_WRMSR, ...);
>       cpuset(...); /* restore prev mask */
>       close(fd);
> 

One of the reasons to leave the cpuid functionality, present in
sysutils/devcpu, in cpuctl(4) was the fact, the software that
is supposed to use wrmsr/rdmsr calls, also usually perform
cpuid checks as well, and it will be clean to provide access to
all of this via a single interface.

-- 
Stanislav Sedov
ST4096-RIPE

Attachment: pgp3zYb4ZJpmR.pgp
Description: PGP signature

Reply via email to