File lparstat-Use-pool_capacity-for-determining-active-cp.patch of Package powerpc-utils
From 26c9baef1e15d5e8a9a9310f057ca18b3123db81 Mon Sep 17 00:00:00 2001
From: Luciano Chavez <lnx1138@linux.ibm.com>
Date: Mon, 29 Sep 2025 15:21:32 -0500
Subject: [PATCH] lparstat: Use pool_capacity for determining active cpus in a
pool
Git-commit: 26c9baef1e15d5e8a9a9310f057ca18b3123db81
Upstream: expected in 1.3.14
The function get_active_cpus_in_pool() primarily used the value from the
physical_procs_allocated_to_virtualization sysentry to represent the
cpus active in a pool. This is incorrect as that value represents
the physical processors in the system allocated to virtualization.
This patch changes the get_active_cpus_in_pool() function to only use
the pool_capacity sysentry for correctly determining the active cpus
in a pool.
Fixes: efa87d93231e ("lparstat: Correct presentation of some stats")
Signed-off-by: Luciano Chavez <chavez@us.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
---
src/lparstat.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/lparstat.c b/src/lparstat.c
index 8eddd7c..9158353 100644
--- a/src/lparstat.c
+++ b/src/lparstat.c
@@ -785,13 +785,8 @@ void get_active_cpus_in_pool(struct sysentry *se, char *buf)
{
struct sysentry *tmp;
- tmp = get_sysentry("physical_procs_allocated_to_virtualization");
- if (tmp) {
- sprintf(buf, "%d", atoi(tmp->value));
- } else {
- tmp = get_sysentry("pool_capacity");
- sprintf(buf, "%d", atoi(tmp->value)/100);
- }
+ tmp = get_sysentry("pool_capacity");
+ sprintf(buf, "%d", atoi(tmp->value)/100);
}
void get_memory_mode(struct sysentry *se, char *buf)
--
2.51.0