[PATCH 1/2] lparstat: print 'Maximum System Processors'

15 views
Skip to first unread message

Srikar Dronamraju

<srikar@linux.ibm.com>
unread,
Jul 16, 2025, 6:54:32 AMJul 16
to Tyrel Datwyler, Shrikanth Hegde, Madhavan Srinivasan, Saket Kumar Bhaskar, powerpc-utils-devel@googlegroups.com, Srikar Dronamraju
Maximum System Processors or Maximum Physical CPUs in System is not
getting reported in lparstat -i. Replace max_system_cpus with
system_potential_processors, since that's how Maximum Physical CPUs in
the system was being tracked in system_data

$ lparstat -i | grep "Maximum System Processors"
$ ./src/lparstat -i | grep "Maximum System Processors"
Maximum System Processors : 80
$

shared_cpus_in_system is same as
physical_procs_allocated_to_virtualization. shared_cpus_in_system was
not getting reported in lparstat -i. Commit 16e49f436470 ("lparstat:
print "Shared Physical CPUS in system" data") added
physical_procs_allocated_to_virtualization but didnt remove
shared_cpus_in_system. Hence clean it up.

Remove hypervisor_page_size, desired_virt_cpus, desired_memory,
desired_capacity, target_mem_factor, target_mem_size, since we are not
printing them anyway.

Signed-off-by: Srikar Dronamraju <sri...@linux.ibm.com>
---
src/lparstat.h | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/lparstat.h b/src/lparstat.h
index 4260e1e56cdd..2e4904419250 100644
--- a/src/lparstat.h
+++ b/src/lparstat.h
@@ -326,10 +326,9 @@ char *iflag_entries[] = {
"MinEntCap",
"partition_max_entitled_capacity",
"CapInc",
- "max_system_cpus",
+ "system_potential_processors",
"system_active_processors",
"active_cpus_in_pool",
- "shared_cpus_in_system",
"physical_procs_allocated_to_virtualization",
"pool_capacity",
"entitled_proc_capacity_available",
@@ -341,16 +340,10 @@ char *iflag_entries[] = {
"entitled_memory_weight",
"entitled_memory_pool_number",
"entitled_memory_pool_size",
- "hypervisor_page_size",
- "unallocated_entitled_memory_weight",
+ "unallocated_entitled_memory_weight",
"unallocated_io_mapping_entitlement",
"entitled_memory_group_number",
- "desired_virt_cpus",
- "desired_memory",
"DesVarCapWt",
- "desired_capacity",
- "target_mem_factor",
- "target_mem_size",
NULL
};

--
2.43.0

Srikar Dronamraju

<srikar@linux.ibm.com>
unread,
Jul 16, 2025, 6:54:43 AMJul 16
to Tyrel Datwyler, Shrikanth Hegde, Madhavan Srinivasan, Saket Kumar Bhaskar, powerpc-utils-devel@googlegroups.com, Srikar Dronamraju
- Shows Resource Group Number to which this LPAR belongs to.
- Also shows the current active processors in this resource group.

Example of an LPAR in a default resource group
root@ltcp11-lp3 $ lparstat -i | grep -i resource
root@ltcp11-lp3 $ ./src/lparstat -i | grep -i resource
Resource Group Number : 0
Active Processors in Resource Group : 50
root@ltcp11-lp3 $

Example of an LPAR in a non-default resource group
root@ltcp11-lp5 $ lparstat -i | grep -i resource
root@ltcp11-lp5 $ ./src/lparstat -i | grep -i resource
Resource Group Number : 1
Active Processors in Resource Group : 30
root@ltcp11-lp5 $

Signed-off-by: Srikar Dronamraju <sri...@linux.ibm.com>
---
man/lparstat.8 | 6 ++++++
src/lparstat.h | 6 ++++++
2 files changed, 12 insertions(+)

diff --git a/man/lparstat.8 b/man/lparstat.8
index 76c46d2e9d2a..ef202509a0a7 100644
--- a/man/lparstat.8
+++ b/man/lparstat.8
@@ -206,6 +206,12 @@ The memory group ID of the Workload Manager group that the LPAR belongs to.
.TP
Desired Variable Capacity Weight
The variable memory capacity weight of the LPAR.
+.TP
+Resource Group Number
+Identifier of Resource Group of Physical processors that this LPAR is a member of.
+.TP
+Active Processors in Resource Group
+Current number of active physical Processors in resource Group containing this LPAR.
.RE
.TP
\fB\-x\fR
diff --git a/src/lparstat.h b/src/lparstat.h
index 2e4904419250..c13cf5233ae0 100644
--- a/src/lparstat.h
+++ b/src/lparstat.h
@@ -197,6 +197,10 @@ struct sysentry system_data[] = {
.descr = "Secondary VIOS Partition ID"},
{.name = "cmo_page_size",
.descr = "Physical Page Size"},
+ {.name = "resource_group_number",
+ .descr = "Resource Group Number"},
+ {.name = "resource_group_active_processors",
+ .descr = "Active Processors in Resource Group"},

/* /proc/meminfo */
{.name = "MemTotal",
@@ -344,6 +348,8 @@ char *iflag_entries[] = {
"unallocated_io_mapping_entitlement",
"entitled_memory_group_number",
"DesVarCapWt",
+ "resource_group_number",
+ "resource_group_active_processors",
NULL
};

--
2.43.0

Shrikanth Hegde

<sshegde@linux.ibm.com>
unread,
Jul 16, 2025, 8:52:46 AMJul 16
to Srikar Dronamraju, Madhavan Srinivasan, Tyrel Datwyler, Saket Kumar Bhaskar, powerpc-utils-devel@googlegroups.com


On 7/16/25 16:24, Srikar Dronamraju wrote:
> - Shows Resource Group Number to which this LPAR belongs to.

Could you please add a short description of what a resource group is
and how can a user make use of this id?

> - Also shows the current active processors in this resource group.
>

Example sections isn't very clear.
Does lparstat means without patch? and ./src/lparstat is with patch?
If so, could you please update it to make it clear?

> Example of an LPAR in a default resource group
> root@ltcp11-lp3 $ lparstat -i | grep -i resource
> root@ltcp11-lp3 $ ./src/lparstat -i | grep -i resource
> Resource Group Number : 0
> Active Processors in Resource Group : 50
> root@ltcp11-lp3 $
>

Is default group number is always 0?

Srikar Dronamraju

<srikar@linux.ibm.com>
unread,
Jul 17, 2025, 10:40:53 AMJul 17
to Tyrel Datwyler, Shrikanth Hegde, Madhavan Srinivasan, Saket Kumar Bhaskar, powerpc-utils-devel@googlegroups.com, Srikar Dronamraju
Maximum System Processors or Maximum Physical CPUs in System is not
getting reported in lparstat -i. Replace max_system_cpus with
system_potential_processors, since that's how Maximum Physical CPUs in
the system was being tracked in system_data

$ lparstat -i | grep "Maximum System Processors"
$ ./src/lparstat -i | grep "Maximum System Processors"
Maximum System Processors : 80
$

[Here ./src/lparstat refers to patched lparstat]

shared_cpus_in_system is same as
physical_procs_allocated_to_virtualization. shared_cpus_in_system was
not getting reported in lparstat -i. Commit 16e49f436470 ("lparstat:
print "Shared Physical CPUS in system" data") added
physical_procs_allocated_to_virtualization but didnt remove
shared_cpus_in_system. Hence clean it up.

Remove hypervisor_page_size, desired_virt_cpus, desired_memory,
desired_capacity, target_mem_factor, target_mem_size, since we are not
printing them anyway.

Signed-off-by: Srikar Dronamraju <sri...@linux.ibm.com>
---
src/lparstat.h | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/lparstat.h b/src/lparstat.h
index 4260e1e56cdd..2e4904419250 100644
--- a/src/lparstat.h
+++ b/src/lparstat.h

Srikar Dronamraju

<srikar@linux.ibm.com>
unread,
Jul 17, 2025, 10:41:00 AMJul 17
to Tyrel Datwyler, Shrikanth Hegde, Madhavan Srinivasan, Saket Kumar Bhaskar, powerpc-utils-devel@googlegroups.com, Srikar Dronamraju
Resource groups is being introduced by PowerVM Hypervisor. System can
be partitioned into different resource groups. Resources are exclusive,
i.e they can be part of only one resource group at any point of time.
By default, all LPARs will be part of default resource group whose
resource group id will be 0. Once a resource group is created and
resources allocated for the resource group, these resources will be
removed from the default resource group. If a LPAR is moved to a
resource group, it can only use resources in that resource group.

Resource groups provides isolation because of which LPARs running one
resource group only contend with other LPARs in their resource group.
This is specifically true for shared LPARs, whose resources are now
being contained within the resource group they belong too.

When a resource group feature is available, this change
- Shows Resource Group Number to which this LPAR belongs to.
- Shows the current active processors in this resource group.

Example of an LPAR in a default resource group.
(lp3 being in default resource group)
lp3 $ lparstat -i | grep -i resource
lp3 $ ./src/lparstat -i | grep -i resource
Resource Group Number : 0
Active Processors in Resource Group : 50
lp3 $

Example of an LPAR in a non-default resource group.
(lp5 being part of non default resource group)
lp5 $ lparstat -i | grep -i resource
lp5 $ ./src/lparstat -i | grep -i resource
Resource Group Number : 1
Active Processors in Resource Group : 30
lp5 $

[Here ./src/lparstat refers to patched lparstat]

Signed-off-by: Srikar Dronamraju <sri...@linux.ibm.com>
---
Changelog:
v1 -> v2: Updated based on comments from Shrikanth Hegde

man/lparstat.8 | 6 ++++++
src/lparstat.h | 6 ++++++
2 files changed, 12 insertions(+)

diff --git a/man/lparstat.8 b/man/lparstat.8
index 76c46d2e9d2a..ef202509a0a7 100644
--- a/man/lparstat.8
+++ b/man/lparstat.8
@@ -206,6 +206,12 @@ The memory group ID of the Workload Manager group that the LPAR belongs to.
.TP
Desired Variable Capacity Weight
The variable memory capacity weight of the LPAR.
+.TP
+Resource Group Number
+Identifier of Resource Group of Physical processors that this LPAR is a member of.
+.TP
+Active Processors in Resource Group
+Current number of active physical Processors in resource Group containing this LPAR.
.RE
.TP
\fB\-x\fR
diff --git a/src/lparstat.h b/src/lparstat.h
index 2e4904419250..c13cf5233ae0 100644
--- a/src/lparstat.h
+++ b/src/lparstat.h
@@ -197,6 +197,10 @@ struct sysentry system_data[] = {
.descr = "Secondary VIOS Partition ID"},
{.name = "cmo_page_size",
.descr = "Physical Page Size"},
+ {.name = "resource_group_number",
+ .descr = "Resource Group Number"},
+ {.name = "resource_group_active_processors",
+ .descr = "Active Processors in Resource Group"},

/* /proc/meminfo */
{.name = "MemTotal",
@@ -344,6 +348,8 @@ char *iflag_entries[] = {
"unallocated_io_mapping_entitlement",
"entitled_memory_group_number",
"DesVarCapWt",
+ "resource_group_number",
+ "resource_group_active_processors",
NULL
};

--
2.43.0

Shrikanth Hegde

<sshegde@linux.ibm.com>
unread,
Aug 6, 2025, 10:10:49 AMAug 6
to Srikar Dronamraju, Tyrel Datwyler, Madhavan Srinivasan, Saket Kumar Bhaskar, powerpc-utils-devel@googlegroups.com
Reviewed-by: Shrikanth Hegde <ssh...@linux.ibm.com>

Shrikanth Hegde

<sshegde@linux.ibm.com>
unread,
Aug 6, 2025, 10:11:35 AMAug 6
to Srikar Dronamraju, Tyrel Datwyler, Madhavan Srinivasan, Saket Kumar Bhaskar, powerpc-utils-devel@googlegroups.com


On 7/17/25 20:10, Srikar Dronamraju wrote:
Reviewed-by: Shrikanth Hegde <ssh...@linux.ibm.com>
Reply all
Reply to author
Forward
0 new messages