linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT pull] perf fix for 4.19
@ 2018-09-29 18:25 Thomas Gleixner
  2018-09-29 18:25 ` [GIT pull] timer fixes " Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas Gleixner @ 2018-09-29 18:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, x86

Greg,

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 single fix for a missing sanity check when a pinned event is tried to be
read on the wrong CPU due to a legit event scheduling failure.

Thanks,

	tglx

------------------>
Reinette Chatre (1):
      perf/core: Add sanity check to deal with pinned event failure


 kernel/events/core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index c80549bf82c6..dcb093e7b377 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3935,6 +3935,12 @@ int perf_event_read_local(struct perf_event *event, u64 *value,
 		goto out;
 	}
 
+	/* If this is a pinned event it must be running on this CPU */
+	if (event->attr.pinned && event->oncpu != smp_processor_id()) {
+		ret = -EBUSY;
+		goto out;
+	}
+
 	/*
 	 * If the event is currently on this CPU, its either a per-task event,
 	 * or local to this CPU. Furthermore it means its ACTIVE (otherwise


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-29 22:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-29 18:25 [GIT pull] perf fix for 4.19 Thomas Gleixner
2018-09-29 18:25 ` [GIT pull] timer fixes " Thomas Gleixner
2018-09-29 22:24   ` Greg Kroah-Hartman
2018-09-29 18:25 ` [GIT pull] x86 fix " Thomas Gleixner
2018-09-29 22:24   ` Greg Kroah-Hartman
2018-09-29 22:24 ` [GIT pull] perf " Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).