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

7 views
Skip to first unread message

Luciano Chavez

<lnx1138@linux.ibm.com>
unread,
Sep 25, 2025, 5:58:22 PMSep 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 PMSep 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

Luciano Chavez

<lnx1138@linux.ibm.com>
unread,
Sep 29, 2025, 4:21:37 PMSep 29
to Tyrel Datwyler, powerpc-utils-devel@googlegroups.com


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 <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,
Oct 15, 2025, 1:47:54 PM (5 days ago) Oct 15
to Luciano Chavez, powerpc-utils-devel@googlegroups.com
On 9/29/25 1:21 PM, Luciano Chavez wrote:
>
>
> 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 <cha...@us.ibm.com>
> ---

Patch applied to powerpc-utils/next branch.

https://github.com/ibm-power-utilities/powerpc-utils/commit/26c9baef1e15d5e8a9a9310f057ca18b3123db81

-Tyrel
Reply all
Reply to author
Forward
0 new messages