Re: getting processor numbers

Paul Jackson
2007-04-04T02:55:43Z

Andrew wrote:
> > But all this of course does not solve the issue sysconf() has. In
> > sysconf we cannot use sched_getaffinity since all the systems CPUs must
> > be reported.
>
> OK.
>
> This is excecptionally gruesome, but one could run sched_getaffinity()
> against pid 1 (init). Which will break nicely in the OS-virtualised future
> when the system has multiple pid-1-inits running in containers...

That nicely breaks on typical cpuset managed systems as well, which
frequently put init into a small cpuset (with the classic Unix daemon
and login load), leaving the bulk of the system to be managed by a
batch scheduler.

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.925.600.0401