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]
Date:   Mon, 6 Feb 2017 13:22:31 +0100
From:   Ingo Molnar <mingo@...nel.org>
To:     Borislav Petkov <bp@...en8.de>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Robert Richter <rric@...nel.org>,
        Vince Weaver <vince@...ter.net>,
        lkml <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] perf/stat: Add --disable-hwdt


* Borislav Petkov <bp@...en8.de> wrote:

> Hi guys,
> 
> so I've been tracing recently on an AMD F15h which has those funky counter
> constraints and am seeing this:
> 
> # ./perf stat sleep 1
> 
>  Performance counter stats for 'sleep 1':
> 
>           0.749208      task-clock (msec)         #    0.001 CPUs utilized          
>                  1      context-switches          #    0.001 M/sec                  
>                  0      cpu-migrations            #    0.000 K/sec                  
>                 54      page-faults               #    0.072 M/sec                  
>          1,122,815      cycles                    #    1.499 GHz                    
>            286,740      stalled-cycles-frontend   #   25.54% frontend cycles idle   
>      <not counted>      stalled-cycles-backend                                        (0.00%)
>      ^^^^^^^^^^^^
>      <not counted>      instructions                                                  (0.00%)
>      ^^^^^^^^^^^^
>      <not counted>      branches                                                      (0.00%)
>      <not counted>      branch-misses                                                 (0.00%)
> 
>        1.001550070 seconds time elapsed
> 
> 
> The problem is that the HW watchdog thing is already taking up a
> counter so when perf stat uses the default counters and when we reach
> stalled-cycles-backend, we run out of counters for the remaining events.
> 
> So how about something like this:
> 
> # ./perf stat --disable-hwdt sleep 1
> 
>  Performance counter stats for 'sleep 1':
> 
>           0.782552      task-clock (msec)         #    0.001 CPUs utilized          
>                  1      context-switches          #    0.001 M/sec                  
>                  0      cpu-migrations            #    0.000 K/sec                  
>                 55      page-faults               #    0.070 M/sec                  
>          1,163,246      cycles                    #    1.486 GHz                    
>            293,598      stalled-cycles-frontend   #   25.24% frontend cycles idle   
>            400,017      stalled-cycles-backend    #   34.39% backend cycles idle    
>            676,505      instructions              #    0.58  insn per cycle         
>                                                   #    0.59  stalled cycles per insn
>            133,822      branches                  #  171.007 M/sec                  
>              7,319      branch-misses             #    5.47% of all branches        
> 
>        1.001660058 seconds time elapsed
> 
> We did explore other opportunities on IRC like sharing counters or
> making the HW WDT thing a 'soft' counter but all those are nasty and
> probably not really worth the trouble of touching perf core just so that
> this works.
> 
> Besides, future generations don't have those constraints anymore so it
> is only F15h.
> 
> Below is a silly patch as a syntactic sugar helper for perf stat. This
> is just an RFC anyway, I'll do it properly with fopen() if you're ok
> with the approach.

Looks sensible, and I'd in fact make this the new default behavior (if root runs 
perf stat) - i.e. add a flag to re-enable it, for the rare case where we want to 
debug a hard deadlock while running perf stat ...

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ