Re: [PATCH] cpumask 5/10 rewrite cpumask.h - single bitmap based implementation

Andrew Morton
2004-06-04T18:29:42Z

William Lee Irwin III <wli@holomorphy.com> wrote:
>
> _SC_NPROCESSOR_CONF is
> unimplementable. NR_CPUS serves as an upper bound on the number of cpus
> that may at some time be simultaneously present in the future.

NR_CPUS is arguably the correct thing when it comes to copying per-cpu info
to and from userspace.

Sometimes userspace wants to know NR_CPUS. Sometimes it wants to know the
index of the max possible CPU. Sometimes, perhaps the index of the max
online CPU. Sometimes the max index of the CPUs upon which this task is
eligible to run. Sometimes (lame) userspace may want to know, at compile
time, the maximum number of CPUs which a Linux kernel will ever support.

It's not completely trivial.

Which of the above is _SC_NPROCESSOR_CONF supposed to return?