diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-08 00:24:06 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-08 00:24:06 +0200 |
commit | 9fe1155233c8290ca6e206053e531ef87f9026ea (patch) | |
tree | ef0d45b2562e01beb8ce4cb4cd016155b4e32a65 /kernel/events | |
parent | ethernet: ti: cpts: Use devm_kcalloc() instead of devm_kzalloc() (diff) | |
parent | Merge tag 'nfsd-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/... (diff) | |
download | linux-9fe1155233c8290ca6e206053e531ef87f9026ea.tar.xz linux-9fe1155233c8290ca6e206053e531ef87f9026ea.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 20367196fa9a..ef29882c9dc4 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -3707,6 +3707,29 @@ static noinline int visit_groups_merge(struct perf_cpu_context *cpuctx, return 0; } +static inline bool event_update_userpage(struct perf_event *event) +{ + if (likely(!atomic_read(&event->mmap_count))) + return false; + + perf_event_update_time(event); + perf_set_shadow_time(event, event->ctx); + perf_event_update_userpage(event); + + return true; +} + +static inline void group_update_userpage(struct perf_event *group_event) +{ + struct perf_event *event; + + if (!event_update_userpage(group_event)) + return; + + for_each_sibling_event(event, group_event) + event_update_userpage(event); +} + static int merge_sched_in(struct perf_event *event, void *data) { struct perf_event_context *ctx = event->ctx; @@ -3725,14 +3748,15 @@ static int merge_sched_in(struct perf_event *event, void *data) } if (event->state == PERF_EVENT_STATE_INACTIVE) { + *can_add_hw = 0; if (event->attr.pinned) { perf_cgroup_event_disable(event, ctx); perf_event_set_state(event, PERF_EVENT_STATE_ERROR); + } else { + ctx->rotate_necessary = 1; + perf_mux_hrtimer_restart(cpuctx); + group_update_userpage(event); } - - *can_add_hw = 0; - ctx->rotate_necessary = 1; - perf_mux_hrtimer_restart(cpuctx); } return 0; @@ -6324,6 +6348,8 @@ accounting: ring_buffer_attach(event, rb); + perf_event_update_time(event); + perf_set_shadow_time(event, event->ctx); perf_event_init_userpage(event); perf_event_update_userpage(event); } else { |