Core test

According to Local, Near & Far Memory part 3 - Scheduling processes to SMT & Virtual Processors 
"In AIX, each Simultaneous Multi-Thread is called a logical CPU - the AIX kernel can allocate a process or process thread to a Logical CPU."

In my previous post I pushed one of those logical CPUs to the max.
In this post I will tickle the whole core.

Reminder for 1 hog ======

My CPU intensive process (hog) ran for 11 seconds, but it was on the processor for only 5.96 seconds (usr+sys), CPU utilization is 52%.
Per mpstat logical processor 31 is 100% (us+sy) busy while also showing 0.52 physical processor consumed (pc).

real    0m11.41s	<- 0.52=(4.44+1.52)/11.41
user    0m4.44s
sys     0m1.52s

cpu    min    maj    mpc    int     cs    ics     rq    mig   lpa   sysc    us    sy    wa    id    pc   %ec   lcs
 31      0      0      0    115     91     91      1      0 100.0 335814  74.3  25.7   0.0   0.0  0.52  43.0    92

2 hogs ======

I am running 2 hogs on logical CPUs 30 & 31, those CPUs are assigned to the same core.
Each hog is using 0.45 core, core is 90% utilized.
Each hog is running slower, run times are 1.4 times longer (1.4=16.02/11.41).
Each hog is maxing out the logical CPU it is running on.

nmon2thread

bindprocessor $$ 31
time echo "scale=12;for(x=0;x<700000;++x){1+1.243;}" | bc >/dev/null &
bindprocessor $$ 30
time echo "scale=12;for(x=0;x<700000;++x){1+1.243;}" | bc >/dev/null &

real    0m16.02s	<- 0.45=(5.42+1.82)/16.02
user    0m5.42s
sys     0m1.82s

real    0m16.02s
user    0m5.42s
sys     0m1.82s

mpstat -w 5 10000 | egrep '^ 31|^ 30|^ 29|^ 28'
cpu    min    maj    mpc    int     cs    ics     rq    mig   lpa   sysc    us    sy    wa    id    pc   %ec   lcs
 30      2      0      0     53     48     46      0      1 100.0 121123  75.0  25.0   0.0   0.0  0.45  56.9    47
 31      1      0      0     53     48     46      0      1 100.0 120752  75.0  25.0   0.0   0.0  0.45  56.8    47

4 hogs ======

Hogs are running on logical CPU's 28, 29, 30, and 31 - same core.
Each hog is using 0.25 core capacity, core is 100% utilized.
Each is running even slower, run times are 2 times longer compared to a single hog (1.99=22.74/11.41)
Per mpstat each hog is maxing out the logical CPU.

nmon4thread


bindprocessor $$ 31
time echo "scale=12;for(x=0;x<700000;++x){1+1.243;}" | bc >/dev/null &
bindprocessor $$ 30
time echo "scale=12;for(x=0;x<700000;++x){1+1.243;}" | bc >/dev/null &
bindprocessor $$ 29
time echo "scale=12;for(x=0;x<700000;++x){1+1.243;}" | bc >/dev/null &
bindprocessor $$ 28
time echo "scale=12;for(x=0;x<700000;++x){1+1.243;}" | bc >/dev/null &

real    0m22.74s 	<-- (4.15+1.52)/22.74=0.24934 
user    0m4.15s
sys     0m1.52s

real    0m22.74s
user    0m4.12s
sys     0m1.54s

real    0m22.73s
user    0m4.12s
sys     0m1.54s

real    0m22.73s
user    0m4.13s
sys     0m1.53s


mpstat -w 5 10000 | egrep '^ 31|^ 30|^ 29|^ 28'
cpu    min    maj    mpc    int     cs    ics     rq    mig   lpa   sysc    us    sy    wa    id    pc   %ec   lcs
 28      0      0      0    112      4      2      1      0 100.0 184549  73.0  27.0   0.0   0.0  0.25  11.0   103
 29      0      0      0    115      4      2      1      0 100.0 184613  72.8  27.2   0.0   0.0  0.25  11.0   102
 30      0      0      0    115      4      2      1      0 100.0 184610  72.9  27.1   0.0   0.0  0.25  11.0   102
 31      0      0      0    116      4      2      1      0 100.0 184580  73.4  26.6   0.0   0.0  0.25  11.1   102


I ran these tests on AIX; I only have 1 CPU on my Linux virtual machine, not much of a core test.
Let me know what you see on a Linux machine with several Intel cores.
Run times should stay flat until the number of hogs exceed available cores.

Advertisements