• Athira Rajeev's avatar
    tools/perf: Fix perf bench futex to enable the run when some CPU's are offline · 18337358
    Athira Rajeev authored
    
    
    Perf bench futex fails as below when attempted to run on
    on a powerpc system:
    
     ./perf bench futex all
     Running futex/hash benchmark...
    Run summary [PID 626307]: 80 threads, each operating on 1024 [private] futexes for 10 secs.
    
    perf: pthread_create: No such file or directory
    
    In the setup where this perf bench was ran, difference was that
    partition had 640 CPU's, but not all CPUs were online. 80 CPUs
    were online. While blocking the threads with futex_wait, code
    sets the affinity using cpumask. The cpumask size used is 80
    which is picked from "nrcpus = perf_cpu_map__nr(cpu)". Here the
    benchmark reports fail while setting affinity for cpu number which
    is greater than 80 or higher, because it attempts to set a bit
    position which is not allocated on the cpumask. Fix this by changing
    the size of cpumask to number of possible cpus and not the number
    of online cpus.
    Signed-off-by: default avatarAthira Rajeev <atrajeev@linux.vnet.ibm.com>
    Reviewed...
    18337358
futex-lock-pi.c 6.05 KB