Resolves: #2166871, lparstat showing incorrect mode in a dedicated-donating LPAR
This commit is contained in:
parent
b6996f7421
commit
576549f850
@ -0,0 +1,93 @@
|
||||
commit f4c2b0d142f623e7dd28a5d685e446d41be75601
|
||||
Author: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
|
||||
Date: Thu Aug 25 12:19:27 2022 +0530
|
||||
|
||||
lparstat: Fix display of mode for dedicated-donating partition
|
||||
|
||||
From the lparstat man page:
|
||||
mode
|
||||
Indicates whether the partition processor capacity is capped or uncapped
|
||||
allowing it to consume idle cycles from the shared pool. Dedicated LPAR
|
||||
is capped or donating.
|
||||
|
||||
However, on a dedicated partition, lparstat always displays the mode as
|
||||
'Capped' today. Fix this by using 'DedDonMode' field from lparcfg for
|
||||
determining the cycle donation status of a dedicated partition.
|
||||
|
||||
On a dedicated-donating partition:
|
||||
$ grep -e shared -e DedDonMode -e capped /proc/powerpc/lparcfg
|
||||
DedDonMode=1
|
||||
capped=1
|
||||
shared_processor_mode=0
|
||||
|
||||
Before this patch:
|
||||
$ lparstat
|
||||
|
||||
System Configuration
|
||||
type=Dedicated mode=Capped smt=8 lcpu=1 mem=3335424 kB cpus=0 ent=1.00
|
||||
|
||||
After this patch:
|
||||
$ lparstat
|
||||
|
||||
System Configuration
|
||||
type=Dedicated mode=Donating smt=8 lcpu=1 mem=3335424 kB cpus=0 ent=1.00
|
||||
|
||||
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
|
||||
Reviewed-by: Nathan Lynch <nathanl@linux.ibm.com>
|
||||
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
|
||||
|
||||
diff --git a/src/lparstat.c b/src/lparstat.c
|
||||
index 0b30fc9..e998e8c 100644
|
||||
--- a/src/lparstat.c
|
||||
+++ b/src/lparstat.c
|
||||
@@ -718,6 +718,16 @@ void get_capped_mode(struct sysentry *se, char *buf)
|
||||
sprintf(buf, "%s", value);
|
||||
}
|
||||
|
||||
+void get_dedicated_mode(struct sysentry *se, char *buf)
|
||||
+{
|
||||
+ const char *value = "Capped";
|
||||
+
|
||||
+ if (se->value[0] == '1')
|
||||
+ value = "Donating";
|
||||
+
|
||||
+ sprintf(buf, "%s", value);
|
||||
+}
|
||||
+
|
||||
void get_percent_entry(struct sysentry *se, char *buf)
|
||||
{
|
||||
float value;
|
||||
@@ -1057,7 +1067,10 @@ void print_system_configuration(void)
|
||||
get_sysdata("shared_processor_mode", &descr, value);
|
||||
offset = sprintf(buf, "type=%s ", value);
|
||||
sprintf(type, "%s", value);
|
||||
- get_sysdata("capped", &descr, value);
|
||||
+ if (!strcmp(value, "Dedicated"))
|
||||
+ get_sysdata("DedDonMode", &descr, value);
|
||||
+ else
|
||||
+ get_sysdata("capped", &descr, value);
|
||||
offset += sprintf(buf + offset, "mode=%s ", value);
|
||||
get_sysdata("smt_state", &descr, value);
|
||||
offset += sprintf(buf + offset, "smt=%s ", value);
|
||||
diff --git a/src/lparstat.h b/src/lparstat.h
|
||||
index 26ed4ba..b7c88e9 100644
|
||||
--- a/src/lparstat.h
|
||||
+++ b/src/lparstat.h
|
||||
@@ -47,6 +47,7 @@ typedef struct cpu_sysfs_file_desc cpu_sysfs_fd;
|
||||
|
||||
extern void get_smt_state(struct sysentry *, char *);
|
||||
extern void get_capped_mode(struct sysentry *, char *);
|
||||
+extern void get_dedicated_mode(struct sysentry *, char *);
|
||||
extern void get_memory_mode(struct sysentry *, char *);
|
||||
extern void get_percent_entry(struct sysentry *, char *);
|
||||
extern void get_phys_cpu_percentage(struct sysentry *, char *);
|
||||
@@ -110,7 +111,8 @@ struct sysentry system_data[] = {
|
||||
{.name = "DesVarCapWt",
|
||||
.descr = "Desired Variable Capacity Weight"},
|
||||
{.name = "DedDonMode",
|
||||
- .descr = "Dedicated Donation Mode"},
|
||||
+ .descr = "Dedicated Donation Mode",
|
||||
+ .get = &get_dedicated_mode},
|
||||
{.name = "partition_entitled_capacity",
|
||||
.descr = "Partition Entitled Capacity"},
|
||||
{.name = "system_active_processors",
|
@ -1,6 +1,6 @@
|
||||
Name: powerpc-utils
|
||||
Version: 1.3.10
|
||||
Release: 3%{?dist}
|
||||
Release: 4%{?dist}
|
||||
Summary: PERL-based scripts for maintaining and servicing PowerPC systems
|
||||
|
||||
Group: System Environment/Base
|
||||
@ -13,6 +13,7 @@ Patch1: powerpc-utils-1.3.10-distro.patch
|
||||
Patch3: powerpc-utils-b1b9e7-LMB_size_4GB.patch
|
||||
Patch4: powerpc-utils-e1f1de-lmb_address_in_hexadecimal.patch
|
||||
Patch5: powerpc-utils-fix_setting_primary_slave_across_reboots.patch
|
||||
Patch6: powerpc-utils-f4c2b0-fix_display_of_mode_for_dedicated_donating_partition.patch
|
||||
|
||||
ExclusiveArch: ppc %{power64}
|
||||
|
||||
@ -191,6 +192,9 @@ systemctl enable hcn-init.service >/dev/null 2>&1 || :
|
||||
%{_mandir}/man8/lparnumascore.8*
|
||||
|
||||
%changelog
|
||||
* Tue Apr 25 2023 Than Ngo <than@redhat.com> - 1.3.10-4
|
||||
- Resolves: #2166871, lparstat showing incorrect mode in a dedicated-donating LPAR
|
||||
|
||||
* Mon Nov 28 2022 Than Ngo <than@redhat.com> - 1.3.10-3
|
||||
- Resolves: #2148878, HNV bond fails to come up with sriov interface as active slave
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user