Subject: Re: kernel multithreading?
To: None <netbsd-help@NetBSD.org>
From: George Georgalis <george@galis.org>
List: netbsd-help
Date: 01/10/2007 15:31:31
On Wed, Jan 10, 2007 at 02:12:57PM -0500, George Georgalis wrote:
>On Wed, Jan 10, 2007 at 11:42:57AM -0500, Sten Daniel S?rsdal wrote:
>>Hi
>>
>>I am currently searching for a BSD variant for a
>>multiprocessor/multicore based application and i was curious as to how
>>suitable the NetBSD kernel is to these types of applications.
>>
>>Is the kernel pretty much GIANT locked?
>>
>>Does anyone have any experience on how well it scales on 4 or 8 core
>>situations?
>
>I did some benchmarks recently of a single thread app running
>on a quad dual core Opteron 2.0 Ghz / 8Gb RAM. I found near 1:1
>performance per Ghz compared to a single cpu single core 2.2 Ghz
>opteron system (at target load of 1)---as long as the load was kept
>at 8. ie performance loss running with a target load above or
>below (7 or 9) the number of cores.


On Thu, Jan 11, 2007 at 06:48:03AM +1100, wrote:
>my best wishes for the coming new year and my hopes that your christmas
>was a happy, holy and peaceful one.

happy new year!

>i find this whole concept of multiple cpu/cores to be very hard to
>grok, let alone to understand how computer work with multiple cpus when
>teh kernel is esentially capable of doing one job at a time and even if
>you have more than one cpu the op/sys still goes about its buisness as
>if it had one cpu only it issues more cpu cycles so that some process
>get through thier load faster ??

An easy way to check is to do your builds, and while they are
going on run top in another term. If you see any of the CPUs idle 
then you know you can load up the machine more. It's okay to have
a load higher than one if the idle time is not 0%, the load can
increase (if you are waiting for disk or net IO) without utilizing
the cpu, but if the idle time is 0% any load over the number of
cores you have is an indicator of inefficiency as the kernel needs
to spend time task switching (loading variable into memory, cpu 
registers, etc, as one job is paused so another can get cpu time).

The bottom line is if you don't *need* to simultaneous process 
jobs, don't fork more tasks than you have idle time. As for using
make -j, it might help if you've got lots of cores, but it's not
common practice and could lead to bugs the non -j developers don't
see, that's happened to me.

// George


-- 
George Georgalis, systems architect, administrator <IXOYE><