LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-11-2009, 04:38 AM   #1
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Rep: Reputation: 26
To get list of processes runing under a particular processor


Hi,

In my system I have 4 processors, namely 0-4. If I want to know what are the processes which are running under a particular processors at a particular time frame(say processor 3)....what command I should use?

I am in a bit hurry...fast responses will be highly appreciable

-kd
 
Old 02-11-2009, 05:25 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Not sure if that's possible under my 2.6.18.1 kernel processes are constantly migrating from cpu to cpu as the system sees fit.
 
Old 02-11-2009, 05:43 AM   #3
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
Thats true...and thats wht I want the various processes running at a particular time frame on a particular processor....

How u are checking the CPU to CPU migration of processes?
Even knowing the PID of the processes under one particular CPU will also serve my purpose.
 
Old 02-11-2009, 08:46 AM   #4
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by kauuttt View Post
Thats true...and thats wht I want the various processes running at a particular time frame on a particular processor....

How u are checking the CPU to CPU migration of processes?
On my old Fedora Core 6 install (removed it Saturday to install Fedora Core 10) I had a GTK app called GKrellM - it was a system monitor applet that would show me which CPU was most heavily loaded. Examining this graph and starting up a raytracing process (Povray) you could clearly see the povray process migrate back and forth between my two cores. BTW I do not have multiple CPUs, I have an old HT P4... don't know if this might be relevant, the fact that I have two "hyper threads" not real, physically seperate CPUs.

Plus, on my system, if you go into top, you can see that there is a seperate "migration" thread running all the time.

Quote:
Even knowing the PID of the processes under one particular CPU will also serve my purpose.
As far as I know PID for a process will stay the same across CPUs...? I. e. PID itself won't help you know which CPU is running a particular process.

Maybe you can check out the "top" binary or gnutools where top is located (I think) - my older "top" on FC6 used to show, at the top, a summary for each "cpu" (hyperthread, in my case) and if I remember right there was a way to, for example, show all processes on a certain "cpu" (hyperthread). This might help you partway... but I've got no idea (programming wise) how top did this (i. e. select processes-per-cpu).
 
Old 02-11-2009, 11:19 PM   #5
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
Thanks....any other suggestions???
 
Old 02-12-2009, 05:26 AM   #6
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
The best I can think of is to post on a Linux kernel specific forum / group or site... You seem to need some input from somebody who intimately know the kernel and the way it switches userspace tasks around from CPU to CPU. I'm pretty sure there's a way to do what you want, but it requires some really low-level and specialised knowledge of the Linux kernel.
 
Old 02-12-2009, 06:04 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
From your (now closed) duplicate thread ...
Quote:
Actaully after using 'sar' command My 1 CPU is showing 100% usage...I want to know what are the processes that are responsible for this 100%...

From top I can see that one of my process is taking 110% CPU (But not sure which CPU)...Thats why need to know the current processes runing under a particular CPU..
From the 'top' command I can easily get the last CPU used by the process...but that will help out...

Moreover is there any way by which I can know the CPU usage of threads of a particular process.As I am getting 110% CPU usage of 1 process...I need to know which threads of this process are taking more CPU....
I see no reason why you think you need to know what is actually running at any point in time on CPU1 - and it may change before you can see anyway. Run top and enter "H" (capital) to see thread view. Should enable you to determine if you have a thread running wild - much more likely to be of interest.
 
Old 02-13-2009, 12:55 AM   #8
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
Quote:
Originally Posted by syg00 View Post
I see no reason why you think you need to know what is actually running at any point in time on CPU1 and it may change before you can see anyway.
'syg00' thanks for ur suggestion !!
But I need this thing because I need to confirm which process (leaving the one which is taking 110%) are chewing up the CPU..So I need it to know the process runing for a CPU in a particular time frame..if it change also it doesn't matter to me...as I will be motinering the all CPUs which will be having 100%..

Quote:
Originally Posted by syg00 View Post
Run top and enter "H" (capital) to see thread view. Should enable you to determine if you have a thread running wild - much more likely to be of interest.
This one is helpfull generally..I tried it before. But I am having some issues with this..
Let me say that assume process A is taking 110% CPU...when 'on' the thread option (Typing H)...I can see the threds names as also 'A'..I mean after 'H' the process A is divided among 6-7 'A' showing different usage...But I am not able to see the exact names...maybe I need to do something while building the process...

And after typing 'H' it shows the output for 2-3 secs..how can I make it in interactive mode..

-kd
 
Old 02-18-2009, 11:36 AM   #9
mbostwick
Member
 
Registered: Feb 2009
Location: Where ever life takes me
Distribution: gentoo,opensuse,ubuntu, arch
Posts: 110

Rep: Reputation: 18
htop?

Ever looked at htop ?
 
  


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
To get list of processes runing under a particular processor kauuttt Linux - Kernel 5 02-12-2009 05:22 PM
Where a processor runing Linux read his code after boot ? J-P V-R Linux - Embedded & Single-board computer 7 01-05-2009 10:51 AM
adding proc list and task list of active processes. pravin.embedded Linux - Newbie 1 09-02-2008 01:20 PM
Run all OS processes on one core in multicore processor tryon16 Linux - Kernel 6 10-02-2007 05:13 PM
dual processor system=more running processes? plisken Linux - Hardware 0 12-09-2004 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:10 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
Open Source Consulting | Domain Registration