From 61647f1b951f3b4389ce2321cbbb258103f1c8fa Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 14 Jun 2016 00:00:00 -0500 Subject: [PATCH] top: swat nasty obscure bug associated with numa nodes When experimenting with two macro constants for stat.c (#define STACKS_INCR & #define NEWOLD_INCR), a bug was revealed in top, only surfacing if both were set to 1. At those settings an absolute minimum number of stacks would be allocated for CPUs & numa NODEs. This in turn led top to overrun the lessor number of nodes since he used the cpu index when accessing those numa stack(s). What he should have been accessing was the cpu stacks. Signed-off-by: Jim Warner --- top/top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/top/top.c b/top/top.c index d20f8fd3..1c58b0a6 100644 --- a/top/top.c +++ b/top/top.c @@ -4714,7 +4714,7 @@ numa_oops: if (Numa_node_sel == CPU_VAL(stat_NU, s_int, i)) { if (!isROOM(anyFLG, 1)) break; snprintf(tmp, sizeof(tmp), N_fmt(WORD_eachcpu_fmt), CPU_VAL(stat_ID, s_int, i)); - summary_hlp(Stat_reap->nodes->stacks[i], tmp); + summary_hlp(Stat_reap->cpus->stacks[i], tmp); Msg_row += 1; } }