Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Solaris kernel - runs on CPU0, or all CPUs?

6 views
Skip to first unread message

Jim Leonard

unread,
Nov 20, 2009, 2:21:31 PM11/20/09
to
It was old unix knowledge I received a long long time ago that said
that the Solaris kernel ran only on CPU0. Nowadays, when I look deep
at a Solaris 10 x86 system, I'm not so sure I am seeing that any
more. For example, we have an application that is extremely SYS heavy
(unoptimized code) that calls time-related functions a lot, which
eventually breaks down into a gtime() storm. Yet when the app is
running, I don't see CPU0 go way up, only the CPU that the application
is on.

So was that knowledge always wrong? Does the Solaris kernel run on
all CPUs, or is it indeed limited to running on CPU 0?

Dan McDonald

unread,
Nov 20, 2009, 2:41:44 PM11/20/09
to
In article <566e6314-288b-4c61...@a32g2000yqm.googlegroups.com>,

Jim Leonard <moby...@gmail.com> wrote:
>It was old unix knowledge I received a long long time ago that said
>that the Solaris kernel ran only on CPU0.

That must be really *(^&^% old, because ever since Solaris 2.0 that's not
been true.

> Nowadays, when I look deep at a Solaris 10 x86 system, I'm not so sure I am
>seeing that any more. For example, we have an application that is extremely
>SYS heavy (unoptimized code) that calls time-related functions a lot, which
>eventually breaks down into a gtime() storm. Yet when the app is running, I
>don't see CPU0 go way up, only the CPU that the application is on.

That makes tons of sense.

>So was that knowledge always wrong?

Wrong, or at least way out of date. (Perhaps this was true on SunOS 4.x?!?
Not true on SunOS 5.x!)

> Does the Solaris kernel run on all CPUs, or is it indeed limited to running
> on CPU 0?

Oh it runs on all CPUs alright! Otherwise I wouldn't have to worry about any
race conditions, locking, interrupt-scattering (or lack thereof on, say,
inbound packets) or any of other such problems that one's kernel code has to
take into account.

Hope this helps!
--
Daniel L. McDonald - Solaris Security & Networking Engineering
Mail: dan...@sun.com | * MY OPINIONS ARE NOT NECESSARILY SUN'S! *
35 Network Drive Burlington, MA |"rising falling at force ten
http://blogs.sun.com/danmcd/ | we twist the world and ride the wind" - Rush

Michael Laajanen

unread,
Nov 20, 2009, 2:49:45 PM11/20/09
to
Hi,

Dan McDonald wrote:
> In article <566e6314-288b-4c61...@a32g2000yqm.googlegroups.com>,
> Jim Leonard <moby...@gmail.com> wrote:
>> It was old unix knowledge I received a long long time ago that said
>> that the Solaris kernel ran only on CPU0.
>
> That must be really *(^&^% old, because ever since Solaris 2.0 that's not
> been true.
>
>> Nowadays, when I look deep at a Solaris 10 x86 system, I'm not so sure I am
>> seeing that any more. For example, we have an application that is extremely
>> SYS heavy (unoptimized code) that calls time-related functions a lot, which
>> eventually breaks down into a gtime() storm. Yet when the app is running, I
>> don't see CPU0 go way up, only the CPU that the application is on.
>
> That makes tons of sense.
>
>> So was that knowledge always wrong?
>
> Wrong, or at least way out of date. (Perhaps this was true on SunOS 4.x?!?
> Not true on SunOS 5.x!)
>
>> Does the Solaris kernel run on all CPUs, or is it indeed limited to running
>> on CPU 0?
>
> Oh it runs on all CPUs alright! Otherwise I wouldn't have to worry about any
> race conditions, locking, interrupt-scattering (or lack thereof on, say,
> inbound packets) or any of other such problems that one's kernel code has to
> take into account.
>
> Hope this helps!

What about IO IRQ, is that handled by one CPU or all?

/michael

Stefaan A Eeckels

unread,
Nov 20, 2009, 3:37:45 PM11/20/09
to
On Fri, 20 Nov 2009 20:49:45 +0100
Michael Laajanen <michael_...@yahoo.com> wrote:

> What about IO IRQ, is that handled by one CPU or all?

By all CPUs that are not marked "no-intr".

Have a look at the "psradm" command for a list of the states a Solaris
CPU can be in. The man page is quite informative.

--
Stefaan A Eeckels
--
People don't ask for facts in making up their minds. They would rather
have one good soul-satisfying emotion than a dozen facts.
--Leavitt

Dan McDonald

unread,
Nov 20, 2009, 3:40:54 PM11/20/09
to
In article <7moaa4F...@mid.individual.net>,
Michael Laajanen <michael_...@yahoo.com> wrote:
>Hi,

Hello!

>What about IO IRQ, is that handled by one CPU or all?

More than one --> man intrd for some implementation details.

Thomas Tornblom

unread,
Nov 21, 2009, 12:26:15 PM11/21/09
to
dan...@kebe.east.sun.com (Dan McDonald) writes:

> In article <566e6314-288b-4c61...@a32g2000yqm.googlegroups.com>,
> Jim Leonard <moby...@gmail.com> wrote:
>>It was old unix knowledge I received a long long time ago that said
>>that the Solaris kernel ran only on CPU0.
>
> That must be really *(^&^% old, because ever since Solaris 2.0 that's not
> been true.
>
>> Nowadays, when I look deep at a Solaris 10 x86 system, I'm not so sure I am
>>seeing that any more. For example, we have an application that is extremely
>>SYS heavy (unoptimized code) that calls time-related functions a lot, which
>>eventually breaks down into a gtime() storm. Yet when the app is running, I
>>don't see CPU0 go way up, only the CPU that the application is on.
>
> That makes tons of sense.
>
>>So was that knowledge always wrong?
>
> Wrong, or at least way out of date. (Perhaps this was true on SunOS 4.x?!?
> Not true on SunOS 5.x!)
>
>> Does the Solaris kernel run on all CPUs, or is it indeed limited to running
>> on CPU 0?
>
> Oh it runs on all CPUs alright! Otherwise I wouldn't have to worry about any
> race conditions, locking, interrupt-scattering (or lack thereof on, say,
> inbound packets) or any of other such problems that one's kernel code has to
> take into account.

The kernel was not multi threaded in SunOS 4.

On some workloads a 690MP would be faster with 2 instead of 4 cpus.

I don't think the kernel always ran on CPU 0 even in SunOS 4.1.2, it
ran of whichever cpu happend to trap into the kernel and grab the
single kernel lock that locked out all other cpu:s. from enetring the
kernel.

>
> Hope this helps!

Thomas

Tim Bradshaw

unread,
Nov 21, 2009, 2:27:43 PM11/21/09
to
On 2009-11-20 19:21:31 +0000, Jim Leonard <moby...@gmail.com> said:

> So was that knowledge always wrong? Does the Solaris kernel run on
> all CPUs, or is it indeed limited to running on CPU 0?

SunOS 4 was bound to one CPU, SunOS 5 has always run on multiple CPUs
and residual serial behaviours have obviously largely been driven out
over time as it has to scale to machines with large numbers of
(virtual) processors. Amdahl's law means that an OS on a machine with
a large number of CPUs really needs to be able to run on many
processors itself.

0 new messages