User avatar
mad-hatter
Posts: 419
Joined: Sun Feb 26, 2012 2:58 pm
Location: By the UK seaside

Pi B 2 Processors - follow on

Thu Feb 12, 2015 10:44 am

Hello,

Original post:- http://www.raspberrypi.org/forums/viewt ... 29&t=99651

Code: Select all

uname -a
Linux mypi 3.18.6-v7+ #754 SMP PREEMPT Sun Feb 8 20:34:22 GMT 2015 armv7l GNU/Linux

Code: Select all

As root
/proc/cpuinfo
bash: /proc/cpuinfo: Permission denied

Code: Select all

top - 10:27:42 up  1:25,  4 users,  load average: 0.01, 0.05, 0.05
Tasks: 178 total,   2 running, 176 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.6 us,  0.2 sy,  0.0 ni, 99.3 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    884304 total,   424424 used,   459880 free,    34404 buffers
KiB Swap:  2097148 total,        0 used,  2097148 free,   225084 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND           
 5049 root      20   0  4680 2496 2100 R   1.3  0.3   0:00.11 top               
    7 root      20   0     0    0    0 S   0.3  0.0   0:05.79 rcu_preempt       
 2088 pi        20   0 18840  14m 4044 S   0.3  1.7   0:48.21 Xtightvnc         
 2722 pi        20   0  133m  26m  21m S   0.3  3.1   0:29.95 lxpanel           
 2961 mysql     20   0  308m  36m 8884 S   0.3  4.2   0:09.77 mysqld            
 3176 pi        20   0 19352 2932 2584 S   0.3  0.3   0:00.62 gvfs-afc-volume   
 3296 pi        20   0  132m  22m  18m R   0.3  2.6   0:25.78 lxpanel           
 4398 pi        20   0 19948 9176 8364 S   0.3  1.0   0:04.03 gksu              
 4425 pi        20   0 19948 9072 8256 S   0.3  1.0   0:04.08 gksu              
    1 root      20   0  2152 1324 1220 S   0.0  0.1   0:02.03 init              
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kthreadd          
    3 root      20   0     0    0    0 S   0.0  0.0   0:00.84 ksoftirqd/0       
    5 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kworker/0:0H      
    6 root      20   0     0    0    0 S   0.0  0.0   0:00.36 kworker/u8:0      
    8 root      20   0     0    0    0 S   0.0  0.0   0:00.00 rcu_sched         
    9 root      20   0     0    0    0 S   0.0  0.0   0:00.00 rcu_bh            
   10 root      rt   0     0    0    0 S   0.0  0.0   0:00.03 migration/0
Can somebody please explain why I don't get the other processors showing in 'top'
and why '/proc/cpuinfo' (run as root) is giving permission denied?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5458
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Pi B 2 Processors - follow on

Thu Feb 12, 2015 10:49 am

mad-hatter wrote: ...
why '/proc/cpuinfo' (run as root) is giving permission denied?
IIRC it's not an "executable file" - try cat /proc/cpuinfo .
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

ross
Posts: 13
Joined: Fri Aug 26, 2011 8:18 pm

Re: Pi B 2 Processors - follow on

Thu Feb 12, 2015 10:51 am

Can somebody please explain why I don't get the other processors showing in 'top'
Run 'top', and then press '1' to toggle between the two views:

Code: Select all

top - 10:50:24 up 23 min,  1 user,  load average: 0.00, 0.01, 0.04
Tasks:  83 total,   1 running,  82 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.2 sy,  0.0 ni, 99.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    948152 total,    64948 used,   883204 free,       20 buffers
KiB Swap:   102396 total,        0 used,   102396 free,    37808 cached
and

Code: Select all

top - 10:50:37 up 23 min,  1 user,  load average: 0.00, 0.01, 0.04
Tasks:  83 total,   1 running,  82 sleeping,   0 stopped,   0 zombie
%Cpu0  :  0.3 us,  1.0 sy,  0.0 ni, 98.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu1  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu3  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    948152 total,    64964 used,   883188 free,       20 buffers
KiB Swap:   102396 total,        0 used,   102396 free,    37808 cached

User avatar
mad-hatter
Posts: 419
Joined: Sun Feb 26, 2012 2:58 pm
Location: By the UK seaside

Re: Pi B 2 Processors - follow on

Thu Feb 12, 2015 11:01 am

Hello,

Many thanks FTrevorGowen and ross.
Worked a treat.

Regards

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Pi B 2 Processors - follow on

Thu Feb 12, 2015 1:04 pm

Yes thanks - that is useful.
So......is there a way of forcing or starting a new process to a particular core?
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

asavah
Posts: 370
Joined: Thu Aug 14, 2014 12:49 am

Re: Pi B 2 Processors - follow on

Thu Feb 12, 2015 1:32 pm

texy wrote:Yes thanks - that is useful.
So......is there a way of forcing or starting a new process to a particular core?
Texy
man taskset
google:// linux cpu affinity
http://www.glennklockwood.com/comp/affinity.php

Sleep Mode zZ
Posts: 319
Joined: Sun Aug 19, 2012 5:56 am
Location: Finland

Re: Pi B 2 Processors - follow on

Thu Feb 12, 2015 1:55 pm

texy wrote:Yes thanks - that is useful.
So......is there a way of forcing or starting a new process to a particular core?
Texy
On my desktop machine I have used schedtool. It was better than taskset for me because it restricts all child processes to the same cpu.

I have a launcer:

Code: Select all

schedtool -a 0x2 -e wine "/home/jjheino/.wine/drive_c/Program Files/Arena/Arena.exe"
It starts Wine and Wine starts Arena. Arena then starts and closes many chess engines (windows executables) when it is their turn. They all are restricted to the same cpu core. It would probably be impossible to achieve this with taskset.

Return to “Advanced users”