Multi Processors

Place to discuss anything, almost. No politics, religion, Microsoft, or anything else that I (the nazi censor) deem inappropriate.

Multi Processors

Postby caveman » Fri Feb 27, 2004 4:49 pm

Bit of a confusing issue this.
Was asked about it a few days ago, and trying to find some proper
material I'm still sort of in the dark.

How does Linux handle multiple processors?
Now I'm not sure about the questions I want to ask - but lets try.

Does the OS fork / create extra jobs to handle the extra processors?
How much of the code is "shared".
How much extra memory is needed? ie. Does each task only require
the non-shared amount of memory needed?
How does the kernel schedule/run tasks on the different cpus?

I have a fair idea how IBM does it on AIX. But Linux seems
to be way different - or am I reading this wrong?

Is there a straight forward block diagram somewhere that illustrates this?
Been to a few sites on the net - but can't find one with all the ins and outs.

I actually have more questions - but cannot think how to phrase them,
and make sense :oops:

Helped a client install RHES 2.1 on a dual processor box (first time
fo me that was) - but cannot really make sense of what now runs
and what is needed.

So lets say I do a real basic install of Linux that uses say 64MB of memory
and then slap in an extra processor and do the reinstall...
how much extra memory is used and by what, which extra
tasks should be visible etc. etc.

Know this all really vague, but like I said, I'm not sure about the
questions. So don't be to harse with the answers.

Regards.
caveman
programmer
programmer
 
Posts: 130
Joined: Sun Feb 09, 2003 1:08 pm
Location: Midrand Gauteng, South Africa

Postby Void Main » Fri Feb 27, 2004 6:12 pm

You don't have to reinstall the OS after adding another processor. The only thing you'll want to do is install the SMP kernel (if you didn't install it on the initial install). Unfortunately I am at home right now and the only machine I can get into at the moment that has multiple processors is running RH 6.2 running kernel "2.2.14-5.0.14smp". :)

At work we have several dual and quad processor machines running Red Hat 8, 9, AS 2.1, and AS 3.0. On the old 2.2 kernel I notice there are no extra processes that show up in the process list but I know on the newer kernels you will see a kernel process running for each CPU (I think it has something like "cpu_0", "cpu_1", etc in the name). Here is the SMP HOWTO which doesn't appear to have a lot of information, and most of it I believe is outdated:

http://www.tldp.org/HOWTO/SMP-HOWTO.html

I know that doesn't really answer any of your questions at all. I'll dig around and see if I can find some up to date documentation (probably searching the LKML would reap the best info).
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Linux Frank » Fri Feb 27, 2004 9:28 pm

http://www.2cpu.com/

Hi, you may find the above link to be helpful, at least in getting started. If nothing else it might let you start to work out the questions you want to ask. They appear to have some good articles (there are some you should avoid - but we are used to that, how else could we be superior if the lesser did not exist to prove ourselves against :) )
Linux Frank
administrator
administrator
 
Posts: 239
Joined: Fri Jan 10, 2003 2:06 pm

Postby caveman » Sun Feb 29, 2004 10:27 am

Tx guys.

Hmmm. went through the links - maybe not useless but not the
kind of info I'm after.

I only re-installed the system with smp to see exactly what the differences
are.
But like I said - I'm not sure at all what to expect eg. the memory usage
between both installs were so small, made me wonder whether the smp
is supposed to use more or not.

As soon as I get time, I'll install something like Oracle and see how
the CPUs are utilised (after tweaking Oracle that is).
Any other off the shelf program I can use to thrash the 2 CPUs and see
how they are used and what the memory/swapspace requirements are??
caveman
programmer
programmer
 
Posts: 130
Joined: Sun Feb 09, 2003 1:08 pm
Location: Midrand Gauteng, South Africa

Postby Void Main » Sun Feb 29, 2004 12:07 pm

Now I see what you are getting at. The number of CPUs really has nothing to do with memory requirements and swap space requirements. Go at those just as you would on a single CPU system. The only real thing that more than one CPU buys you is each thread of a multi-threaded app can get their own CPU. Linux will put each new thread or app on the least utilized processor. And as I mentioned, the only thing that would have been different between your two installs are the kernel itself. The SMP kernel could have been installed right off the CD (rpm -i) and you would have had both kernels on your boot menu. Both installs use all the same apps.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to The Lounge

Who is online

Users browsing this forum: No registered users and 0 guests

cron