CPU architecture– modern day cpu– poking into my laptop CPU configs.

likwid is an awesome tool for hardware poking around and optimization.

As you can see my i7 processor has 4 cores , with each of them seem to support 2 hardware threads.

⏚ [anand:~/playspace] 1 $ likwid-topology
——————————————————————————–
CPU name: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
CPU type: Intel Core IvyBridge processor
CPU stepping: 9
********************************************************************************
Hardware Thread Topology
********************************************************************************
Sockets: 1
Cores per socket: 4
Threads per core: 2
——————————————————————————–
HWThread Thread Core Socket Available
0 0 0 0 *
1 1 0 0 *
2 0 1 0 *
3 1 1 0 *
4 0 2 0 *
5 1 2 0 *
6 0 3 0 *
7 1 3 0 *
——————————————————————————–
Socket 0: ( 0 1 2 3 4 5 6 7 )
——————————————————————————–
********************************************************************************
Cache Topology
********************************************************************************
Level: 1
Size: 32 kB
Cache groups: ( 0 1 ) ( 2 3 ) ( 4 5 ) ( 6 7 )
——————————————————————————–
Level: 2
Size: 256 kB
Cache groups: ( 0 1 ) ( 2 3 ) ( 4 5 ) ( 6 7 )
——————————————————————————–
Level: 3
Size: 6 MB
Cache groups: ( 0 1 2 3 4 5 6 7 )
——————————————————————————–
********************************************************************************
NUMA Topology
********************************************************************************
NUMA domains: 1
——————————————————————————–
Domain: 0
Processors: ( 0 1 2 3 4 5 6 7 )
Distances: 10
Free memory: 613.246 MB
Total memory: 11891.7 MB
——————————————————————————–

More interestingly look at the cache memory. The advertisement is that L3 cache is 6MB, which is true. However note that it is shared by all 8(HW threads). Which means even at the L3 level not all 6MB is available to a given thread. So depending on the nature of the work/program ,sometimes it may be better to use single thread instead of multiple threads.(think whenever there has to be communication in between threads.)

Also note that there is only one socket for all the cores/threads put together.

So if I’m reading this correct this CPU will have trouble processing heavy data that has to be fetched from Disk/NW as it is being processed.(i.e: even if we attempt to write separate threads for the fetching vs calculation parts.)

The takeaway here is that threads that share memory should be on the same socket, and a memory-mapped I/O heavy thread should make sure it’s on the socket that’s closest to the I/O device it’s talking to.

Alright what else does this likwid-* toolset include? Cool likwid-setFrequencies. Let’s see if I can overclock.

⏚ [anand:~] $ likwid-setFrequencies -g 432
The system does not use the acpi-cpufreq driver, other drivers are not usable with likwid-setFrequencies.

Darn it.
Well there are a couple of others like likwid-perfctr/likwid-perfscope but they all segfault..
There’s one likwid-memsweeper, but it seems like it’ll hang the OS. Try it later and update.

Disclaimer: My model of HW/CPU architecture is stuck at the 8086 Architecture I half-paid attention 12 years ago in college.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s