Re: getting processor numbers

From: Paul Jackson
Date: Tue Apr 03 2007 - 22:55:59 EST


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@xxxxxxx> 1.925.600.0401
-
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/