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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1314878012.11566.7.camel@twins>
Date:	Thu, 01 Sep 2011 13:53:32 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Mike Hommey <mh@...ndium.org>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: Problem with perf hardware counters grouping

On Wed, 2011-08-31 at 10:57 +0200, Mike Hommey wrote:
> I'm having two different problems with perf hardware counters with a
> group leader:
> - perf_event_open()ing more than 3 makes all of them always return a
>   value of 0;
> - perf_event_open()ing more than 4 fails with ENOSPC. 


I'm guessing you're running on something x86, either AMD-Fam10-12 or
Intel-NHM+.

Both those have 4 generic hardware counters, but x86 defaults to
enabling the NMI watchdog which takes one, leaving you with 3 (try: echo
0 > /proc/sys/kernel/nmi_watchdog). If you had looked at your dmesg
output you'd have found lines like:

  NMI watchdog enabled, takes one hw-pmu counter.

The code can only check if the group as a whole could possibly fit on a
PMU, which is where your failure on >4 comes from.

What happens with your >3 case is that while the group is valid and
could fit on the PMU, it won't fit at runtime because the NMI watchdog
is taking one and won't budge (cpu-pinned counter have precedence over
any other kind), effectively starving your group of pmu runtime.

Also, we should fix that return to say -EINVAL or so.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ