Commit b9154df3 authored by Will Schmidt's avatar Will Schmidt Committed by Linus Torvalds

[PATCH] ppc64: lparcfg fixes for processor counts

This patch corrects how the lparcfg interface was presenting the number of
active and potential processors.  (As reported in LTC bugzilla number 10889).

- Correct output for partition_potential_processors and
  system_active_processors.
- suppress pool related values in scenarios where they do not make
  sense. (non-shared processor configurations)
- Display pool_capacity as a percentage, to match the behavior from
  iSeries code.
Signed-off-by: default avatarWill Schmidt <willschm@us.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 947cba67
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include <asm/rtas.h> #include <asm/rtas.h>
#include <asm/system.h> #include <asm/system.h>
#define MODULE_VERS "1.3" #define MODULE_VERS "1.4"
#define MODULE_NAME "lparcfg" #define MODULE_NAME "lparcfg"
/* #define LPARCFG_DEBUG */ /* #define LPARCFG_DEBUG */
...@@ -292,7 +292,8 @@ static int lparcfg_count_active_processors(void) ...@@ -292,7 +292,8 @@ static int lparcfg_count_active_processors(void)
static int lparcfg_data(struct seq_file *m, void *v) static int lparcfg_data(struct seq_file *m, void *v)
{ {
int system_active_processors; int partition_potential_processors;
int partition_active_processors;
struct device_node *rootdn; struct device_node *rootdn;
const char *model = ""; const char *model = "";
const char *system_id = ""; const char *system_id = "";
...@@ -323,11 +324,13 @@ static int lparcfg_data(struct seq_file *m, void *v) ...@@ -323,11 +324,13 @@ static int lparcfg_data(struct seq_file *m, void *v)
lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL); lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL);
if (lrdrp == NULL) { if (lrdrp == NULL) {
system_active_processors = systemcfg->processorCount; partition_potential_processors = systemcfg->processorCount;
} else { } else {
system_active_processors = *(lrdrp + 4); partition_potential_processors = *(lrdrp + 4);
} }
partition_active_processors = lparcfg_count_active_processors();
if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
unsigned long h_entitled, h_unallocated; unsigned long h_entitled, h_unallocated;
unsigned long h_aggregation, h_resource; unsigned long h_aggregation, h_resource;
...@@ -342,8 +345,6 @@ static int lparcfg_data(struct seq_file *m, void *v) ...@@ -342,8 +345,6 @@ static int lparcfg_data(struct seq_file *m, void *v)
seq_printf(m, "R6=0x%lx\n", h_aggregation); seq_printf(m, "R6=0x%lx\n", h_aggregation);
seq_printf(m, "R7=0x%lx\n", h_resource); seq_printf(m, "R7=0x%lx\n", h_resource);
h_pic(&pool_idle_time, &pool_procs);
purr = get_purr(); purr = get_purr();
/* this call handles the ibm,get-system-parameter contents */ /* this call handles the ibm,get-system-parameter contents */
...@@ -352,17 +353,28 @@ static int lparcfg_data(struct seq_file *m, void *v) ...@@ -352,17 +353,28 @@ static int lparcfg_data(struct seq_file *m, void *v)
seq_printf(m, "partition_entitled_capacity=%ld\n", seq_printf(m, "partition_entitled_capacity=%ld\n",
h_entitled); h_entitled);
seq_printf(m, "pool=%ld\n",
(h_aggregation >> 0*8) & 0xffff);
seq_printf(m, "group=%ld\n", seq_printf(m, "group=%ld\n",
(h_aggregation >> 2*8) & 0xffff); (h_aggregation >> 2*8) & 0xffff);
seq_printf(m, "system_active_processors=%ld\n", seq_printf(m, "system_active_processors=%ld\n",
(h_resource >> 0*8) & 0xffff); (h_resource >> 0*8) & 0xffff);
seq_printf(m, "pool_capacity=%ld\n", /* pool related entries are apropriate for shared configs */
(h_resource >> 2*8) & 0xffff); if (paca[0].lppaca.xSharedProc) {
h_pic(&pool_idle_time, &pool_procs);
seq_printf(m, "pool=%ld\n",
(h_aggregation >> 0*8) & 0xffff);
/* report pool_capacity in percentage */
seq_printf(m, "pool_capacity=%ld\n",
((h_resource >> 2*8) & 0xffff)*100);
seq_printf(m, "pool_idle_time=%ld\n", pool_idle_time);
seq_printf(m, "pool_num_procs=%ld\n", pool_procs);
}
seq_printf(m, "unallocated_capacity_weight=%ld\n", seq_printf(m, "unallocated_capacity_weight=%ld\n",
(h_resource >> 4*8) & 0xFF); (h_resource >> 4*8) & 0xFF);
...@@ -376,34 +388,28 @@ static int lparcfg_data(struct seq_file *m, void *v) ...@@ -376,34 +388,28 @@ static int lparcfg_data(struct seq_file *m, void *v)
seq_printf(m, "unallocated_capacity=%ld\n", seq_printf(m, "unallocated_capacity=%ld\n",
h_unallocated); h_unallocated);
seq_printf(m, "pool_idle_time=%ld\n",
pool_idle_time);
seq_printf(m, "pool_num_procs=%ld\n",
pool_procs);
seq_printf(m, "purr=%ld\n", seq_printf(m, "purr=%ld\n",
purr); purr);
} else /* non SPLPAR case */ { } else /* non SPLPAR case */ {
seq_printf(m, "system_active_processors=%d\n", seq_printf(m, "system_active_processors=%d\n",
system_active_processors); partition_potential_processors);
seq_printf(m, "system_potential_processors=%d\n", seq_printf(m, "system_potential_processors=%d\n",
system_active_processors); partition_potential_processors);
seq_printf(m, "partition_max_entitled_capacity=%d\n", seq_printf(m, "partition_max_entitled_capacity=%d\n",
100*system_active_processors); partition_potential_processors * 100);
seq_printf(m, "partition_entitled_capacity=%d\n", seq_printf(m, "partition_entitled_capacity=%d\n",
system_active_processors*100); partition_active_processors * 100);
} }
seq_printf(m, "partition_active_processors=%d\n", seq_printf(m, "partition_active_processors=%d\n",
(int) lparcfg_count_active_processors()); partition_active_processors);
seq_printf(m, "partition_potential_processors=%d\n", seq_printf(m, "partition_potential_processors=%d\n",
system_active_processors); partition_potential_processors);
seq_printf(m, "shared_processor_mode=%d\n", seq_printf(m, "shared_processor_mode=%d\n",
paca[0].lppaca.xSharedProc); paca[0].lppaca.xSharedProc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment