LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 01-09-2003, 04:50 AM   #1
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 616

Rep: Reputation: 32
Question Processor affinity and cpu scheduling...?


XP Pro can set affinity on smp systems and change processor priority from low to "realtime" states... does Linux have any type of app or gui that allows this?
 
Old 01-09-2003, 06:01 AM   #2
Bert
Senior Member
 
Registered: Jul 2001
Location: 406292E 290755N
Distribution: GNU/Linux Slackware 8.1, Redhat 8.0, LFS 4.0
Posts: 1,004

Rep: Reputation: 46
I'm not sure what you mean by 'affinity' to a processor on an SMP system (eitherways, WIndows XP Pro can only do up to two processors) if you mean the degree to which the program can utilise the processor in parallel threads, that should be up to the parallel programmer maybe.

As for scheduling on the processor, there's no gui necessary:

nice -n PID

where -n is the priority -20 is the lowest, 19 the highest. If it's already running, renice will change the process' priority on the processor.

Nice, huh?

Bert
 
Old 01-09-2003, 06:27 AM   #3
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 616

Original Poster
Rep: Reputation: 32
Quote:
Originally posted by Bert
I'm not sure what you mean by 'affinity' to a processor on an SMP system (eitherways, WIndows XP Pro can only do up to two processors) if you mean the degree to which the program can utilise the processor in parallel threads, that should be up to the parallel programmer maybe.

As for scheduling on the processor, there's no gui necessary:

nice -n PID

where -n is the priority -20 is the lowest, 19 the highest. If it's already running, renice will change the process' priority on the processor.

Nice, huh?

Bert
Affinity basically boils down to how you wnat the job processed by the set of cpus or cpus anf virtual cpus (If hyper threading is enabled) If you have say a dual processor aware appilcation such as set@home and you start it up and look at the task manager's cpu utilization graph, everything should be started off even on both processors (granted you're on a dual or single ht enabled system) -What you can do is go to the app's process listing, right click on the app and at the bottum of the contextual menu that comes up should say "affinity" (XP Pro and 2000) When you choose this, a window will pop up with all the cpu's checked... what you can do from there is select, say the secondary cpu to do all of the seti@home stuff and uncheck your primary processor so you can use it to do photoshop or word or whatever else you want to run just on one app... it's quite nice on my dual amd... HT P4's... I'm not too sure what good it would do since it's a virtual processor... but anyway, you get the idea... well? Does linux have this?
 
Old 01-09-2003, 01:52 PM   #4
Bert
Senior Member
 
Registered: Jul 2001
Location: 406292E 290755N
Distribution: GNU/Linux Slackware 8.1, Redhat 8.0, LFS 4.0
Posts: 1,004

Rep: Reputation: 46
Right so the affinity is the same as setting a bias towards a processor.

With a normal SMP kernel you can bias a process towards a CPU, which the kernel scheduler does by default. There is a patch somewhere out there which will bind a process (yes, bind a process to a CPU, not just smooch up against it), called PSET. You'll have to do some digging for it though, because the normally hosted site seems to be down.

Bert
 
Old 01-09-2003, 06:59 PM   #5
wdingus
Member
 
Registered: Aug 2001
Location: Kingsport, TN
Distribution: RHEL & FC
Posts: 267

Rep: Reputation: 30
Careful, negative numbers are *higher* priority. From "man nice":

DESCRIPTION
Run COMMAND with an adjusted scheduling priority. With no COMMAND, print the current scheduling priority.
ADJUST is 10 by default. Range goes from -20 (highest priority) to 19 (lowest).
 
Old 01-09-2003, 07:08 PM   #6
Bert
Senior Member
 
Registered: Jul 2001
Location: 406292E 290755N
Distribution: GNU/Linux Slackware 8.1, Redhat 8.0, LFS 4.0
Posts: 1,004

Rep: Reputation: 46
oops.
details! mere details!
 
  


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
editing the linux cpu scheduling algo cathiejcm Linux - Software 1 11-11-2005 07:25 AM
cpu load vs processor use six6 Linux - Newbie 1 11-20-2004 02:11 PM
New processor fan, but CPU still stays at 140 degrees? Help! RHLinuxGUY Linux - Hardware 34 10-02-2004 07:29 PM
Process scheduling (CPU) kiwi_bloke *BSD 1 08-29-2004 09:07 PM
SMP machines - locking a processor to one CPU? Bluesuperman Linux - Hardware 2 10-22-2003 08:52 PM


All times are GMT -5. The time now is 05:53 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration