[PATCH 4/4] powerpc/pseries: Implement CONFIG_PARAVIRT_TIME_ACCOUNTING

shrikanth suresh hegde sshegde at linux.vnet.ibm.com
Fri Jun 3 20:57:44 AEST 2022



On 5/18/22 7:09 PM, Nicholas Piggin wrote:
> CONFIG_VIRT_CPU_ACCOUNTING_GEN under pseries does not implement
> stolen time accounting. Implement it with the paravirt time
> accounting option.
>
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>

Tested-by: Shrikanth Hegde <sshegde at linux.ibm.com>

Patch fails to compile with CONFIG_PARAVIRT=y with below error.
In file included from kernel/sched/core.c:81:
kernel/sched/sched.h:87:11: fatal error: asm/paravirt_api_clock.h: No
such file or directory
    87 | # include <asm/paravirt_api_clock.h>
compilation terminated.

after adding the file, it compiled. Please add the file as well. patch i did.

diff --git a/arch/powerpc/include/asm/paravirt_api_clock.h
b/arch/powerpc/include/asm/paravirt_api_clock.h
new file mode 100644
index 000000000000..65ac7cee0dad
--- /dev/null
+++ b/arch/powerpc/include/asm/paravirt_api_clock.h
@@ -0,0 +1 @@
+#include <asm/paravirt.h>


After successful compilation, it was tested on Power10 Shared LPAR. system has
two LPAR. we will call first one LPAR1 and second one as LPAR2.  Test was
carried out in SMT=1. Similar observation was seen in SMT=8 as well.

LPAR config header from each LPAR is below. LPAR1 is twice as big as LPAR2.
Since Both are sharing the same underlying hardware, work stealing will happen
when both the LPAR's are contending for the same resource.
LPAR1:
type=Shared mode=Uncapped smt=Off lcpu=40 mem=2094637056 kB cpus=40 ent=20.00
LPAR2:
type=Shared mode=Uncapped smt=Off lcpu=20 mem=2083908608 kB cpus=40 ent=10.00

mpstat was used to check for the utilization. stress-ng has been used as the
workload. Few cases are tested. when the both LPAR are idle there is no steal
time. when LPAR1 starts running at 100% which consumes all of the physical
resource, steal time starts to get accounted.  With LPAR1 running at 100% and
LPAR2 starts running, steal time starts increasing. This is as expected. When
the LPAR2 Load is increased further, steal time increases further.

Case 1: 0% LPAR1; 0% LPAR2
CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest %gnice   %idle
all    0.00    0.00    0.05    0.00    0.00    0.00    0.00    0.00    0.00   99.95

Case 2: 100% LPAR1; 0% LPAR2
CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest %gnice   %idle
all   97.68    0.00    0.00    0.00    0.00    0.00    2.32    0.00  0.00    0.00

Case 3: 100% LPAR1; 50% LPAR2
CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest %gnice   %idle
all   86.34    0.00    0.10    0.00    0.00    0.03   13.54    0.00  0.00    0.00

Case 4: 100% LPAR1; 100% LPAR2
CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest %gnice   %idle
all   78.54    0.00    0.07    0.00    0.00    0.02   21.36    0.00  0.00    0.00

Case 5: 50% LPAR1; 100% LPAR2
CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest %gnice   %idle
all   49.37    0.00    0.00    0.00    0.00    0.00    1.17    0.00  0.00    49.47

Patch is accounting for the steal time and basic tests are holding good.

-- Shrikanth Hegde


More information about the Linuxppc-dev mailing list