• K
    perf/core: Fix implicitly enable dynamic interrupt throttle · ab7fdefb
    Kan Liang 提交于
    This patch fixes an issue which was introduced by commit:
    
      91a612ee ("perf/core: Fix dynamic interrupt throttle")
    
    ... which commit unconditionally sets the perf_sample_allowed_ns value
    to !0. But that could trigger a bug in the following corner case:
    
    The user can disable the dynamic interrupt throttle mechanism by setting
    perf_cpu_time_max_percent to 0. Then they change perf_event_max_sample_rate.
    For this case, the mechanism will be enabled implicitly, because
    perf_sample_allowed_ns becomes !0 - which is not what we want.
    
    This patch only updates perf_sample_allowed_ns when the dynamic
    interrupt throttle mechanism is enabled.
    Signed-off-by: NKan Liang <kan.liang@intel.com>
    Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Vince Weaver <vincent.weaver@maine.edu>
    Cc: acme@kernel.org
    Link: http://lkml.kernel.org/r/1462260366-3160-1-git-send-email-kan.liang@intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
    ab7fdefb
core.c 245.6 KB