Skip to content

Commit

Permalink
lparstat: app: Use pic value at boot for accurate boot time reporting
Browse files Browse the repository at this point in the history
When there are no options specified for lparstat, it is expected to
give reports since LPAR(Logical Partition) boot. APP(Available Physical
Processors) is an indicator for available cores in an Shared Processor
LPAR(SPLPAR). APP is derived using pool_idle_time which is obtained
using H_PIC call.

The interval based reports show correct APP value while since boot
report shows very high APP values. This happens because in that case APP
is obtained by dividing pool idle time by LPAR uptime. Since pool idle
time is reported by the PowerVM hypervisor since its boot, it need not
align with LPAR boot.

To fix that use the boot pool idle time added newly in the lparcfg as
below.

APP = (pool idle time - boot pool idle time) / (uptime * timebase)

*This depends on "powerpc/pseries: Add pool idle time at LPAR boot" be
merged into kernel*

Results:  (Observe APP values)
========================================================================
lparstat
System Configuration
type=Shared mode=Uncapped smt=8 lcpu=12 mem=15573440 kB cpus=37 ent=12.00

reboot
stress-ng --cpu=$(nproc) -t 600
sleep 600
So in this case app is expected to close to 37-6=31.

====== 6.9-rc1 and lparstat 1.3.10  =============
%user  %sys %wait    %idle    physc %entc lbusy   app  vcsw phint
----- ----- -----    -----    ----- ----- ----- ----- ----- -----
47.48  0.01  0.00    52.51     0.00  0.00 47.49 69099.72 541547    21

=== With this patch and this patch to do the above equation ===
%user  %sys %wait    %idle    physc %entc lbusy   app  vcsw phint
----- ----- -----    -----    ----- ----- ----- ----- ----- -----
47.48  0.01  0.00    52.51     5.73 47.75 47.49 31.21 541753    21

Signed-off-by: Shrikanth Hegde <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
  • Loading branch information
Shrikanth Hegde authored and tyreld committed Jul 26, 2024
1 parent 2af8c0b commit 81c51b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lparstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ void get_cpu_app(struct sysentry *unused_se, char *buf)
se = get_sysentry("pool_idle_time");
new_app = strtoll(se->value, NULL, 0);
if (se->old_value[0] == '\0') {
old_app = 0;
se = get_sysentry("boot_pool_idle_time");
old_app = strtoll(se->value, NULL, 0);
} else {
old_app = strtoll(se->old_value, NULL, 0);
}
Expand Down
2 changes: 2 additions & 0 deletions src/lparstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ struct sysentry system_data[] = {
.get = &get_percent_entry},
{.name = "pool_idle_time",
.descr = "Shared Processor Pool Idle Time"},
{.name = "boot_pool_idle_time",
.descr = "Shared Processor Pool Idle Time"},
{.name = "pool_num_procs",
.descr = "Shared Processor Pool Processors"},
{.name = "unallocated_capacity_weight",
Expand Down

0 comments on commit 81c51b5

Please sign in to comment.