lkml.org 
[lkml]   [2018]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf: correct ctx_event_type in ctx_resched()
On Mon, Mar 05, 2018 at 09:55:04PM -0800, Song Liu wrote:
> In ctx_resched(), EVENT_FLEXIBLE should be sched_out when EVENT_PINNED is
> added. However, ctx_resched() calculates ctx_event_type before checking
> this condition. As a result, pinned events will NOT get higher priority
> than flexible events.
>
> The following shows this issue on an Intel CPU (where ref-cycles can
> only use one hardware counter).
>
> 1. First start:
> perf stat -C 0 -e ref-cycles -I 1000
> 2. Then, in the second console, run:
> perf stat -C 0 -e ref-cycles:D -I 1000
>
> The second perf uses pinned events, which is expected to have higher
> priority. However, because it failed in ctx_resched(). It is never
> run.
>
> This patch fixes this by calculating ctx_event_type after re-evaluating
> event_type.
>
> Fixes: 487f05e18aa4 ("perf/core: Optimize event rescheduling on active contexts")
> Signed-off-by: Song Liu <songliubraving@fb.com>
> Reported-by: Ephraim Park <ephiepark@fb.com>

Thanks!

\
 
 \ /
  Last update: 2018-03-06 09:55    [W:0.038 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site