X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fperf%2Fbench%2Fnuma.c;h=ba5efa4710b558239ff79c08b025ddc2da06efc5;hb=1d90a685eb75a56648d7dd22c704a1a6da516de9;hp=cd872e9c3a9cee99175cb58022328559a0541c1c;hpb=24f1ced167e5e011040b4c3aae75aee45a79eed5;p=firefly-linux-kernel-4.4.55.git diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index cd872e9c3a9c..ba5efa4710b5 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -828,6 +828,9 @@ static int count_process_nodes(int process_nr) td = g->threads + task_nr; node = numa_node_of_cpu(td->curr_cpu); + if (node < 0) /* curr_cpu was likely still -1 */ + return 0; + node_present[node] = 1; } @@ -882,6 +885,11 @@ static void calc_convergence_compression(int *strong) for (p = 0; p < g->p.nr_proc; p++) { unsigned int nodes = count_process_nodes(p); + if (!nodes) { + *strong = 0; + return; + } + nodes_min = min(nodes, nodes_min); nodes_max = max(nodes, nodes_max); }