This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Limit perf data buffer during profiling


On 05/18/2017 12:09 PM, Mike Stump wrote:
On May 18, 2017, at 1:35 AM, Aldy Hernandez <aldyh@redhat.com> wrote:

Andi Kleen <andi@firstfloor.org> writes:

From: Andi Kleen <ak@linux.intel.com>

With high -j parallelism the autofdo tests can randomly fail.
autofdo uses Linux perf to record profiling data.
Linux perf uses a locked perf buffer. By default it has
around 516k buffer per uid (/proc/sys/kernel/perf_event_mlock_kb).

An individual perf record tries to grab the full 516k,
which makes parallel perf record fail.

This patch limits the perf buffer for individual perf record to 8k.
With the default settings this allows a parallelism of the test
cases of 16, which is hopefully good enough

So for -jN > 16 it would silently fail again?

I think we should warn when the -jN is sufficiently large such that
tests will randomly fail, and perhaps suggest workarounds with
ulimit/etc.

Not a big fan of warning.  I'd rather smell the max, and divide by n, or limit them to 4 (or 16 or any fix constant) and pass appropriate arguments or anything else that just fixes it.


You'll hear no complaints from me :).
Aldy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]