lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171124153249.ga4gdvsxl4t43uzt@linux-n805>
Date:   Fri, 24 Nov 2017 07:32:49 -0800
From:   Davidlohr Bueso <dave@...olabs.net>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     James Yang <james.yang@....com>,
        Kim Phillips <kim.phillips@....com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Darren Hart <dvhart@...radead.org>,
        Colin Ian King <colin.king@...onical.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] perf bench futex: benchmark only online CPUs

On Thu, 23 Nov 2017, Arnaldo Carvalho de Melo wrote:

>Em Thu, Nov 23, 2017 at 12:09:48PM -0300, Arnaldo Carvalho de Melo escreveu:
>> Em Wed, Nov 22, 2017 at 06:25:28PM -0600, Kim Phillips escreveu:
>> > From: James Yang <james.yang@....com>
>> >
>> > The "perf bench futex" benchmarks have a problem when not all CPUs in
>> > the system are online:  perf assumes the CPUs that are online are
>> > contiguously numbered and assigns processor affinity to the threads by
>> > modulo striping.  When the online CPUs are not contiguously numbered,
>> > perf errors out with:

Good catch. Non contiguously numbered cpus was certainly not something I had
considered.

>> >
>> > $ echo 0 | sudo tee /sys/devices/system/cpu/cpu3/online
>> > 0
>> > $ ./oldperf bench futex all
>> > perf: pthread_create: Operation not permitted
>> > Run summary [PID 14934]: 7 threads, each operating on 1024 [private] futexes for 10 secs.
>> >
>> > $
>> >
>> > This patch makes perf not assume all CPUs configured are online, and
>> > adds a mapping table to stripe affinity across the CPUs that are
>> > online.
>>
>> So, have you looked at tools/perf/util/cpumap.c? I think you can use:
>>
>> 	int i;
>> 	struct cpu_map *cpus = cpu_map__new(NULL);
>>
>> 	for (i = 0; i < cpus->nr; ++i) {
>> 		int cpu = cpus->map[i];
>> 		...
>> 	}
>>
>> No?

Ah, I was just thinking there should be something like this in perf already :)

>
>But then, this can be done later, as probably will result in more
>changes, I'm continuing to review the other patches.

Unsure if you're implying otherwise, but I would strongly prefer a v2 was sent
to use the perf's cpumap.c.

Thanks,
Davidlohr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ