diff options
| author | Ingo Molnar <mingo@kernel.org> | 2016-03-31 09:55:12 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2016-03-31 09:55:12 +0200 |
| commit | 84c48d8d01b74a2b98c164513ca5e37c73166825 (patch) | |
| tree | f157fe93864dd9a08029cb62b50d707e7db186d5 /kernel | |
| parent | 643cb15ba07260faadd9fcfabac4f5d9d0ddc053 (diff) | |
| parent | 85dc600263c2291cea33bffa90038808ee64198b (diff) | |
| download | cachepc-linux-84c48d8d01b74a2b98c164513ca5e37c73166825.tar.gz cachepc-linux-84c48d8d01b74a2b98c164513ca5e37c73166825.zip | |
Merge branch 'perf/urgent' into perf/core, to fix up fixes before queueing up new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/events/core.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index de24fbce5277..52bedc5a5aaa 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -2417,14 +2417,24 @@ static void ctx_sched_out(struct perf_event_context *ctx, cpuctx->task_ctx = NULL; } - is_active ^= ctx->is_active; /* changed bits */ - + /* + * Always update time if it was set; not only when it changes. + * Otherwise we can 'forget' to update time for any but the last + * context we sched out. For example: + * + * ctx_sched_out(.event_type = EVENT_FLEXIBLE) + * ctx_sched_out(.event_type = EVENT_PINNED) + * + * would only update time for the pinned events. + */ if (is_active & EVENT_TIME) { /* update (and stop) ctx time */ update_context_time(ctx); update_cgrp_time_from_cpuctx(cpuctx); } + is_active ^= ctx->is_active; /* changed bits */ + if (!ctx->nr_active || !(is_active & EVENT_ALL)) return; @@ -8532,6 +8542,7 @@ SYSCALL_DEFINE5(perf_event_open, f_flags); if (IS_ERR(event_file)) { err = PTR_ERR(event_file); + event_file = NULL; goto err_context; } |
