Skip to contentSkip to conversation

perf updates for 4.5

GIT PULL Thomas Gleixner 1 participant 1 message Feb 28, 2016 perf events

lore
Share & tools
lore
#0 lore raw

Linus,

please pull the latest perf-urgent-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-for-linus

A rather largish series of 12 patches addressing a maze of race conditions in the perf core code from Peter Zijlstra.

Thanks,

tglx

------------------>
Peter Zijlstra (12):
perf: Close install vs. exit race
perf: Do not double free
perf: Allow perf_release() with !event->ctx
perf: Only update context time when active
perf: Fix cloning
perf: Fix race between event install and jump_labels
perf: Cure event->pending_disable race
perf: Fix ctx time tracking by introducing EVENT_TIME
perf: Fix scaling vs. perf_event_enable_on_exec()
perf: Fix scaling vs. perf_event_enable()
perf: Fix scaling vs. perf_install_in_context()
perf: Robustify task_function_call()

 include/linux/perf_event.h |   7 +-
 kernel/events/core.c       | 368 +++++++++++++++++++++++++++++----------------
 2 files changed, 244 insertions(+), 131 deletions(-)
include/linux/perf_event.h +4 -3
index b35a61a481fa..f5c5a3fa2c81 100644
@@ -397,6 +397,7 @@ struct pmu {
  * enum perf_event_active_state - the states of a event
  */
 enum perf_event_active_state {
+	PERF_EVENT_STATE_DEAD		= -4,
 	PERF_EVENT_STATE_EXIT		= -3,
 	PERF_EVENT_STATE_ERROR		= -2,
 	PERF_EVENT_STATE_OFF		= -1,
@@ -905,7 +906,7 @@ perf_sw_event_sched(u32 event_id, u64 nr, u64 addr)
 	}
 }
 
-extern struct static_key_deferred perf_sched_events;
+extern struct static_key_false perf_sched_events;
 
 static __always_inline bool
 perf_sw_migrate_enabled(void)
@@ -924,7 +925,7 @@ static inline void perf_event_task_migrate(struct task_struct *task)
 static inline void perf_event_task_sched_in(struct task_struct *prev,
 					    struct task_struct *task)
 {
-	if (static_key_false(&perf_sched_events.key))
+	if (static_branch_unlikely(&perf_sched_events))
 		__perf_event_task_sched_in(prev, task);
 
 	if (perf_sw_migrate_enabled() && task->sched_migrated) {
@@ -941,7 +942,7 @@ static inline void perf_event_task_sched_out(struct task_struct *prev,
 {
 	perf_sw_event_sched(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 0);
 
-	if (static_key_false(&perf_sched_events.key))
+	if (static_branch_unlikely(&perf_sched_events))
 		__perf_event_task_sched_out(prev, next);
 }
 
kernel/events/core.c +240 -128

692 lines not on this page · raw message