Skip to content

Commit 1b9540c

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Thomas Gleixner: "A rather largish series of 12 patches addressing a maze of race conditions in the perf core code from Peter Zijlstra" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Robustify task_function_call() perf: Fix scaling vs. perf_install_in_context() perf: Fix scaling vs. perf_event_enable() perf: Fix scaling vs. perf_event_enable_on_exec() perf: Fix ctx time tracking by introducing EVENT_TIME perf: Cure event->pending_disable race perf: Fix race between event install and jump_labels perf: Fix cloning perf: Only update context time when active perf: Allow perf_release() with !event->ctx perf: Do not double free perf: Close install vs. exit race
2 parents 4b696dc + 0da4cf3 commit 1b9540c

2 files changed

Lines changed: 244 additions & 131 deletions

File tree

‎include/linux/perf_event.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ struct pmu {
397397
* enum perf_event_active_state - the states of a event
398398
*/
399399
enum perf_event_active_state {
400+
PERF_EVENT_STATE_DEAD = -4,
400401
PERF_EVENT_STATE_EXIT = -3,
401402
PERF_EVENT_STATE_ERROR = -2,
402403
PERF_EVENT_STATE_OFF = -1,
@@ -905,7 +906,7 @@ perf_sw_event_sched(u32 event_id, u64 nr, u64 addr)
905906
}
906907
}
907908

908-
extern struct static_key_deferred perf_sched_events;
909+
extern struct static_key_false perf_sched_events;
909910

910911
static __always_inline bool
911912
perf_sw_migrate_enabled(void)
@@ -924,7 +925,7 @@ static inline void perf_event_task_migrate(struct task_struct *task)
924925
static inline void perf_event_task_sched_in(struct task_struct *prev,
925926
struct task_struct *task)
926927
{
927-
if (static_key_false(&perf_sched_events.key))
928+
if (static_branch_unlikely(&perf_sched_events))
928929
__perf_event_task_sched_in(prev, task);
929930

930931
if (perf_sw_migrate_enabled() && task->sched_migrated) {
@@ -941,7 +942,7 @@ static inline void perf_event_task_sched_out(struct task_struct *prev,
941942
{
942943
perf_sw_event_sched(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 0);
943944

944-
if (static_key_false(&perf_sched_events.key))
945+
if (static_branch_unlikely(&perf_sched_events))
945946
__perf_event_task_sched_out(prev, next);
946947
}
947948

0 commit comments

Comments
 (0)