LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-15-2004, 12:08 PM   #1
sh_roohani
LQ Newbie
 
Registered: Dec 2004
Distribution: Redhat 9.0, Knoppix 3.2
Posts: 2

Rep: Reputation: 0
Dual processor task distribution question


Hi all,

I have a dual processor Asus server containing two Xeon 3.0 GHz CPUs. Well, the problem is I don't know if the OS is using both CPUs to perform task distribution. I mean how can I determine if a specific task is running on a specific CPU. For example task list only shows process IDs, but not the processor on which a specific process is running. I used cpuinfo file, but it only asserts that I have two CPUs.

Is there any solution through which I can force a specific task to run on a specific CPU? I mean if I have a time consuming task, I prefer to run it on one of my CPUs and do the rest through the other one.

Regards,
Shahram Roohani
 
Old 12-15-2004, 12:54 PM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
I don't know of an existing utility to do this, and a (very) quick google didn't turn up anything either, but if you're C savvy you can write one:

$ man sched_setaffinity
 
Old 12-15-2004, 12:56 PM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
how the kernel schedules dual cpu is rather complex
if you are using a 2.6.x series kernel cpu sceduling is quite good
if you are using 2.4.x kernel cpu scheduling is terrible and you should upgrade your kernel
generally each cpu has it's own task cue and each task has an afinity for only one cpu.
this is so each task has access to its cpu memory caches (pipes) otherwise if tasks switched between cpus
it would create a situation of memory duplication and cause terrible thrashing of the cpu cache as tasks were resumed. Of course this is just a general picture. Basically if you are running a modern kernel just don't worry about it cause it is being done quite eficiently.

if you wish to play with sceduling read this (might be fun)
http://kerneltrap.org/node/3366?PHPS...fa895960901a09
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual processor vs. Dual core cs. single on home machine fincher69 Linux - Hardware 3 03-04-2005 01:37 PM
Installing Linux on a dual processor machine (only one processor detected) rocordial Linux - Hardware 1 11-27-2004 03:16 AM
? Dual Processor ? AMathewsFL Linux - Newbie 2 06-01-2004 12:47 AM
4 processor listings in cpuinfo on dual processor system. atticboy1 Linux - Hardware 2 02-08-2004 07:35 PM
Kernel Panic on Dual Processor Motherboard with only 1 Processor olar Linux - Software 1 10-13-2001 04:57 PM


All times are GMT -5. The time now is 07:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration