<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div><br></div><div><br></div><div>-----Original Message-----</div><div><b>From</b>: Athira Rajeev <<a href="mailto:Athira%20Rajeev%20%3catrajeev@linux.vnet.ibm.com%3e">atrajeev@linux.vnet.ibm.com</a>></div><div><b>To</b>: <a href="mailto:acme@kernel.org">acme@kernel.org</a>, <a href="mailto:jolsa@kernel.org">jolsa@kernel.org</a>, <a href="mailto:disgoel@linux.vnet.ibm.com">disgoel@linux.vnet.ibm.com</a></div><div><b>Cc</b>: <a href="mailto:mpe@ellerman.id.au">mpe@ellerman.id.au</a>, <a href="mailto:linux-perf-users@vger.kernel.org">linux-perf-users@vger.kernel.org</a>, <a href="mailto:linuxppc-dev@lists.ozlabs.org">linuxppc-dev@lists.ozlabs.org</a>, <a href="mailto:maddy@linux.vnet.ibm.com">maddy@linux.vnet.ibm.com</a>, <a href="mailto:rnsastry@linux.ibm.com">rnsastry@linux.ibm.com</a>, <a href="mailto:kjain@linux.ibm.com">kjain@linux.ibm.com</a>, <a href="mailto:linux-kernel@vger.kernel.org">linux-kernel@vger.kernel.org</a>, <a href="mailto:srikar@linux.vnet.ibm.com">srikar@linux.vnet.ibm.com</a>, <a href="mailto:irogers@google.com">irogers@google.com</a></div><div><b>Subject</b>: [PATCH V3 0/2] Fix perf bench numa to work with machines having #CPUs > 1K</div><div><b>Date</b>: Tue, 12 Apr 2022 22:10:57 +0530</div><div><br></div><pre>The perf benchmark for collections: numa hits failure in system</pre><pre>configuration with CPU's more than 1024. These benchmarks uses</pre><pre>"sched_getaffinity" and "sched_setaffinity" in the code to</pre><pre>work with affinity.</pre><pre><br></pre><pre>Example snippet from numa benchmark:</pre><pre><<>></pre><pre>perf: bench/numa.c:302: bind_to_node: Assertion `!(ret)' failed.</pre><pre>Aborted (core dumped)</pre><pre><<>></pre><pre><br></pre><pre>bind_to_node function uses "sched_getaffinity" to save the cpumask.</pre><pre>This fails with EINVAL because the default mask size in glibc is 1024</pre><pre><br></pre><pre>To overcome this 1024 CPUs mask size limitation of cpu_set_t,</pre><pre>change the mask size using the CPU_*_S macros ie, use CPU_ALLOC to</pre><pre>allocate cpumask, CPU_ALLOC_SIZE for size, CPU_SET_S to set mask bit.</pre><pre><br></pre><pre>Fix all the relevant places in the code to use mask size which is large</pre><pre>enough to represent number of possible CPU's in the system.</pre><pre><br></pre><pre>This patchset also address a fix for parse_setup_cpu_list function in</pre><pre>numa bench to check if input CPU is online before binding task to</pre><pre>that CPU. This is to fix failures where, though CPU number is within</pre><pre>max CPU, it could happen that CPU is offline. Here, sched_setaffinity</pre><pre>will result in failure when using cpumask having that cpu bit set</pre><pre>in the mask.</pre><pre><br></pre><pre>Patch 1 address fix for parse_setup_cpu_list to check if CPU used to bind</pre><pre>task is online. Patch 2 has fix for bench numa to work with machines</pre><pre>having #CPUs > 1K</pre><pre><br></pre><pre>Athira Rajeev (2):</pre><pre>  tools/perf: Fix perf bench numa testcase to check if CPU used to bind</pre><pre>    task is online</pre><pre>  perf bench: Fix numa bench to fix usage of affinity for machines with</pre><pre>    #CPUs > 1K</pre><pre><br></pre><pre>Changelog:</pre><pre>v2 -> v3</pre><pre>Link to the v2 version :</pre><a href="https://lore.kernel.org/all/20220406175113.87881-1-atrajeev@linux.vnet.ibm.com/"><pre>https://lore.kernel.org/all/20220406175113.87881-1-atrajeev@linux.vnet.ibm.com/</pre></a><pre><br></pre><pre> - From the v2 version, patch 1 and patch 2 are now part of upstream.</pre><pre> - This v3 version separates patch 3 and patch 4 to address review</pre><pre>   comments from arnaldo which includes using sysfs__read_str for reading</pre><pre>   sysfs file and fixing the compilation issues observed in debian</pre><pre><br></pre><pre style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Tesed the patches on powerpc with CPU > 1K and other configurations as well, verified the perf bench numa with the patch set.</pre><pre style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Tested-by: Disha Goel <<a href="mailto:disgoel@linux.vnet.ibm.com">disgoel@linux.vnet.ibm.com</a>></pre><pre style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></pre><pre style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"> tools/perf/bench/numa.c  | 136 +++++++++++++++++++++++++++++----------</pre><pre> tools/perf/util/header.c |  51 +++++++++++++++</pre><pre> tools/perf/util/header.h |   1 +</pre><pre> 3 files changed, 153 insertions(+), 35 deletions(-)</pre><pre><br></pre></body></html>