[PATCH] lparstat: Use pool_capacity for determining active cpus in a pool

1 view
Skip to first unread message

Luciano Chavez

<lnx1138@linux.ibm.com>
unread,
Sep 25, 2025, 5:58:22 PM (2 days ago) Sep 25
to powerpc-utils-devel@googlegroups.com
commit efa87d93231eb0fe4f406bf58e7d5aa783ee4f13 introduced a change
in get_active_cpus_in_pool() that 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 reverts the get_active_cpus_in_pool() function to only use
the pool_capacity sysentry for correctly determining the active cpus
in a pool.

Signed-off-by: Luciano Chavez <cha...@us.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.47.3

Tyrel Datwyler

<tyreld@linux.ibm.com>
unread,
Sep 25, 2025, 7:53:18 PM (2 days ago) Sep 25
to Luciano Chavez, powerpc-utils-devel@googlegroups.com
On 9/25/25 2:58 PM, Luciano Chavez wrote:
> commit efa87d93231eb0fe4f406bf58e7d5aa783ee4f13 introduced a change
> in get_active_cpus_in_pool() that 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 reverts the get_active_cpus_in_pool() function to only use
> the pool_capacity sysentry for correctly determining the active cpus
> in a pool.
>

Need a fixes tag as this was a regression introduced by a previous commit.

-Tyrel
Reply all
Reply to author
Forward
0 new messages