FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Open Source
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
October 09, 2009
Moblin 2.0 Is Multicore Ready

Gaston Hillar
Taking advantage of hardware threads

Moblin v2.0 for Intel Atom Processor based netbooks is already available. Developers with Linux experience will find it easy to target this new attractive platform. However, many developers have many questions related to the multicore support offered this new operating system. [Editor's Note: For more information on Moblin, see Dr. Dobb's Moblin Zone.]

Most modern Atom processors offer Hyper-Threading. I've already talked about some experiences in Downsizing Multicore Programming Skills to Take Advantage of Intel Atom. When you check the microprocessors' specifications, the manufacturer explains that the operating system and the applications have to be optimized to take advantage of Hyper-Threading. What about Moblin v2.0? Does it support multicore? Is it able to scale when more cores are available? There is already a netbook manufacturer using two Intel Atom processors, creating a multiprocessor netbook. Is Moblin v2.0 able to support this configuration?

The answer to all these questions is simple: Moblin v2.0 uses a Linux kernel. Therefore, checking the Linux kernel version, I'll be able to answer all these questions. Opening a Terminal window and typing:

uname -sr

You can get the complete kernel name and its release number.

The result will display:

Linux 2.6.30.3-4.1.moblin2-netbook

as shown in the following:

Moblin v2.0 displaying the Linux kernel name and release.

This means that we have an operating system using a Linux 2.6.30.3-4.1 kernel for Moblin v2.0. You can check all the features supported in the same release for the generic kernel in http://www.kernel.org/pub/linux/kernel/v2.6/. Nonetheless, my focus is on the multicore and Hyper-Threading support. This kernel version has full support for multicore and Hyper-Threading, therefore, you have a multiprocessor capable kernel. Moblin v2.0 scheduler can work with 2 or more logical cores. If you install Moblin v2.0 in a netbook with more than one Intel Atom processor, it will be able to take full advantage of all the available logical cores.

You can also run the following command to get the kernel:

uname -v

You can get the detailed version information.

The result will display:

#1 SMP PREEMPT Mon Jul 27 12:26:15 UTC 2009

as shown in the following picture:

Moblin v2.0 displaying the kernel's detailed version information.

It is very clear that the kernel offers SMP support. Does it recognize the underlying hardware, with Hyper-Threading enabled? It's also easy to check it.

Opening a Terminal window and typing:

lscpu

You can get the detailed information about the logical (hardware threads) and physical cores detected by Moblin v2.0.

The result will display:

You can see it in the following picture:

Moblin v2.0 displaying the information about the Intel Atom processor with its 2 logical cores (hardware threads).

This means that the CPU is running at 800 MHz instead of 1,600 MHz (1.6 GHz) because it's idle. If you run the command many times, it will show different speeds, according to the logical cores' load. In the following picture, the same command shows the CPU running at 1,600 MHz.

Moblin v2.0 displaying the information about the Intel Atom processor with its two logical cores (hardware threads) running at 1,600 MHz.

Using your parallel programming skills, you can take advantage of the two hardware threads available and achieve a better performance when targeting Moblin v2.0 running on Intel Atom processors. Don't even think about creating serial code when you have two hardware threads available. Remember, the battery life is also going to thank your efforts to take advantage of Hyper-Threading on these platforms.

TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK