lkml.org 
[lkml]   [2012]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 08/12] perf/x86-ibs: Trigger overflow if remaining period is too small
    Date
    There are cases where the remaining period is smaller than the minimal
    possible value. In this case the counter is restarted with the minimal
    period. This is of no use as the interrupt handler will trigger
    immediately again and most likely hits itself. This biases the
    results.

    So, if the remaining period is within the min range, we better do not
    restart the counter and instead trigger the overflow.

    Signed-off-by: Robert Richter <robert.richter@amd.com>
    ---
    arch/x86/kernel/cpu/perf_event_amd_ibs.c | 5 +----
    1 files changed, 1 insertions(+), 4 deletions(-)

    diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
    index 6591b77..1f53f16 100644
    --- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c
    +++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
    @@ -78,16 +78,13 @@ perf_event_set_period(struct hw_perf_event *hwc, u64 min, u64 max, u64 *hw_perio
    overflow = 1;
    }

    - if (unlikely(left <= 0)) {
    + if (unlikely(left < (s64)min)) {
    left += period;
    local64_set(&hwc->period_left, left);
    hwc->last_period = period;
    overflow = 1;
    }

    - if (unlikely(left < min))
    - left = min;
    -
    if (left > max)
    left = max;

    --
    1.7.8.4



    \
     
     \ /
      Last update: 2012-04-02 20:23    [W:0.023 / U:33.608 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site