Tuesday February 28, 2006 It seems that most chip vendors adopted the multi-threaded way of improving their chip performance. Dual-core CPUs are really hot these days and Sun now sells UltraSPARC-T1 based systems with 8 cores and 32 threads.
Andrei Dorofeev provided a nice introduction to CMT Scheduling Optimizations for SunFire T2000 and James Laudon has an interesting description of threading implementation of the UltraSPARC T1.
Are you one of the lucky ones who got UltraSPARC T1? Or you have a box with an Intel hyper-threaded chip sitting inside? You may be wondering, how many cores does your system have and what are relationships between its physical and virtual processors. The Solaris operating system makes it all transparent - users do not need to know any low-level CPU details to benefit from the new chips. But there are always users who want to know everything.
If you follow The Register, you probably saw the article Sun has at least 1GHz of Niagara Viagra , published in September 2005. Here is a short snippet:
By using a couple of commands and looking at the OpenSolaris code, observers
would seem to be able to tell the Niagara chip's first name and clock speed,
along with future directions for the chip.
$ ./psrinfo -vp
The physical processor has 8 cores and 32 virtual processors
The core 0 has 4 virtual processors (0, 1, 2, 3)
The core 1 has 4 virtual processors (4, 5, 6, 7)
The core 2 has 4 virtual processors (8, 9, 10, 11)
The core 3 has 4 virtual processors (12, 13, 14, 15)
The core 4 has 4 virtual processors (16, 17, 18, 19)
The core 5 has 4 virtual processors (20, 21, 22, 23)
The core 6 has 4 virtual processors (24, 25, 26, 27)
The core 7 has 4 virtual processors (28, 29, 30, 31)
UltraSPARC-T1 (clock 1080 MHz)
Well, I saw this article too and decided to add this cute functionality to the psrinfo(1M) command, so I wrote a version of psrinfo(1M) command that can print the relationships between physical CPUs, cores and virtual CPUs. It requires some kernel support which is available in recent Solaris Nevada builds (32 and above). It should work on both Solaris Express and OpenSolaris versions.
The program is a
Perl Script, which provides a drop-in replacement of the standard psrinfo(1M)
psrinfo(1) command. It has the same options as the original and produces the
same output, but with a twist. On a systems having multiple cores per physical
processor, psrinfo -vp output will look a bit different:
$ uname -i
SUNW,Sun-Fire-T200
$ psrinfo.pl -vp
The physical processor has 8 cores and 32 virtual processors (0-31)
The core has 4 virtual processors (0-3)
The core has 4 virtual processors (4-7)
The core has 4 virtual processors (8-11)
The core has 4 virtual processors (12-15)
The core has 4 virtual processors (16-19)
The core has 4 virtual processors (20-23)
The core has 4 virtual processors (24-27)
The core has 4 virtual processors (28-31)
UltraSPARC-T1 (clock 1000 MHz)
And on x86:
$ uname -a
SunOS bolt 5.11 snv_32 i86pc i386 i86pc
$ psrinfo.pl -vp
The physical processor has 2 cores and 4 virtual processors (0-3)
The core has 2 virtual processors (0 1)
The core has 2 virtual processors (2 3)
x86 (GenuineIntel family 15 model 4 step 4 clock 3211 MHz)
Intel(r) Pentium(r) D CPU 3.20GHz
You can get the new psrinfo command here.
While writing this blog I tried running the new psrinfo.pl command on build 34 and noticed that it doesn't show the core information. It turns out that one of the projects inadvertently removed a small piece of kernel code required to make it work on Niagara platform. This means that the functionality is only available on builds 32 and 33 and build 36 and above which fixed the bug. On x86 platforms it works on all builds, starting from 32.
[ Technorati: NiagaraCMT, Solaris ]
( Feb 28 2006, 07:25:00 PM PST ) Permalink Comments [1]
Posted by Paul Oppenheim on March 25, 2006 at 08:19 PM PST #