LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-06-2007, 06:50 AM   #1
demosp
LQ Newbie
 
Registered: Jul 2004
Location: Cyprus
Posts: 2

Rep: Reputation: 0
Need to find which processor is running a process


Hello guys,

I was wondering if there is a way to find which processor is running a specific process. I'm build a program with parallel processes and is really important to check this because I had a terrible slowdown when I executed the program on kernel 2.6.X in comparison with 2.4.X

Thnx in advance
 
Old 11-06-2007, 07:37 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 62
You can request the psr column in the output of ps, like this:
Code:
ps -e -o pid,psr,cmd
This will list all processes on the system.
 
Old 11-06-2007, 07:25 PM   #3
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,256

Rep: Reputation: 1076Reputation: 1076Reputation: 1076Reputation: 1076Reputation: 1076Reputation: 1076Reputation: 1076Reputation: 1076
If you had a "terrible slowdown," I'll guarantee 'ya that "which processor" has nothing to do with it.

Sorry.
 
Old 11-06-2007, 07:34 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,093

Rep: Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978
Maybe - maybe not. Rapid flip-flopping between processors can be expensive. The scheduler tries to avoid doing it, but it can happen.
I use cpusets to isolate workloads to particular CPU(s) when I need to - try that. I find it easier than trying to set up affinity in diverse applications.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can two process can be scheduled in two different processor in multi processor ? bishalpoudyal Programming 4 08-31-2006 02:22 PM
how to find out what serivces/process are running in fedora yinglcs Linux - General 2 03-06-2006 10:40 AM
How do I know processor usage by a process bipinkdas Linux - Newbie 1 11-04-2005 11:45 PM
How to get it known what processor and memory resources using by the concrete process ukrainet Linux - Newbie 3 12-20-2004 06:41 AM
How do you assign a process to a specific processor? ter_roshak Linux - General 1 12-19-2003 12:38 AM


All times are GMT -5. The time now is 01:18 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