On 6/26/05, Jan Hudec <bulb@xxxxxx> wrote: > On Sun, Jun 26, 2005 at 18:03:25 -0400, Grob Team wrote: > > > I am writing a kernel module, and I want to get the number of CPU. If > > > the machine is UP, the value returned will be 1, but if the machine is > > > SMP, the value returned will be the number of CPU available. > > > > > > > I think NR_CPUS give the number of the cpu in the system. You can use it > > Did you even check what kind of symbol it is? It is a constant macro! > > It actually gives the maximum number of CPUs the particular kernel > binary can handle. This can be configure in config. Maximum is 32 on > 32-bit systems and 64 on 64-bit ones, but can be set lower for minor > performance gain. Hum ok, my mistake. Thank you for the correction. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/