AUTHORS
Alexander Kolbasov
Andrei Dorofeev
Eric Saxe
SUMMARY
Modern processors from SUN and other vendors introduced multi-core
and multi-threading CPUs. Many companies base their licensing
decisions on the number of physical CPUs which do not work well in
the new world of CMT. ISVs require more accurate information
regarding the number of actual chips or cores present which they can
use for more accurate licensing.
This proposal is to add the ability to get information about CPU
cores and CPU chips by adding core ID information to cpu_info kstat
and adding new arguments to sysconf(3C) and getconf(1) to extract
information from the kernel.
PROBLEM
Currently the only way to get information about the number of chips
in the system is by parsing cpu_info kstats. This is not easy to do
from a C/C++/Java program and kstats do not contain information
about CPU cores for multi-core CPUs. ISVs (particularly, Oracle)
require simple interfaces to get information about number of
physical CPUs present in the system to calculate licensing costs.
PROPOSED SOLUTION:
We propose the following changes:
- Add core_id field to cpu_info kstat. The field will have
platform-specific value which is unique for each core in the
system.
- Add new arguments to the sysconfig(3C):
_SC_NCORES_CONF: CPU cores configured
_SC_NCORES_ONLN: CPU cores online
_SC_NCHIPS_CONF: CPU chips configured
_SC_NCHIPS_ONLN: CPU chips online
- Add new arguments to getconf(1):
NCORES_CONF: CPU cores configured
NCORES_ONLN: CPU cores online
NCHIPS_CONF: CPU chips configured
NCHIPS_ONLN: CPU chips online
This will allow access to the number of cores and chips available
both from programming languages and shell scripts.
The information returned by the new interfaces above will be
virtualized for local zones that have been configured to access only
a limited set of CPUs in a resource pool. Both sysconf(3C) and
getconf(1) will return total numbers of cores and chips available
within a zone.
Commitment Level: Stable