mirror of https://gitee.com/openkylin/linux.git
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Thomas writes: "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." * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Add sanity check to deal with pinned event failure
This commit is contained in:
commit
af17b3aa1f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue