girish_kumar
Posts: 31
Joined: Thu Sep 12, 2013 5:59 pm

SMP on Raspberry PI (Symmetric Multi Processing)

Thu Jan 12, 2017 11:39 am

Folks,

I am trying to see how SMP works on Raspberry PI

The build I am using Linux 4.1.13-v7+ #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015 armv7l GNU/Linux

When I run a multiprocessing app or multitheraded app how do which thread/process is running on which core ?

I tried using top and ps none of them is showing me the CPU core information can anyone help ?

Search on the internet has not helped

Regards
Girish

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: SMP on Raspberry PI (Symmetric Multi Processing)

Thu Jan 12, 2017 11:52 am

You can get "top" to display the last used core for each task - press 'f' to bring up the field selector, use cursor up/down to find the 'P' field, press 'd' (or space) to toggle it to display. Now you need to move it before the command column, otherwise you won't see it: press cursor right to select it, move it with cursor up/down, then press cursor left (or enter) to commit it. Finally, press 'q' to take you back to the list.

girish_kumar
Posts: 31
Joined: Thu Sep 12, 2013 5:59 pm

Re: SMP on Raspberry PI (Symmetric Multi Processing)

Thu Jan 12, 2017 12:38 pm

Thanks a lot PhilE it worked
I can see four cores being used 1 to 3 in the top command now

Regards
Girish

Return to “Advanced users”