Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 11-06-2007, 06:50 AM   #1
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
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

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

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

Old 11-06-2007, 07:34 PM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,802

Rep: Reputation: 2167Reputation: 2167Reputation: 2167Reputation: 2167Reputation: 2167Reputation: 2167Reputation: 2167Reputation: 2167Reputation: 2167Reputation: 2167Reputation: 2167
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.


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 > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:30 AM.

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