Skip to content

Commit 1908dc9

Browse files
author
Peter Zijlstra
committed
perf: Tweak perf_event_attr::exclusive semantics
Currently perf_event_attr::exclusive can be used to ensure an event(group) is the sole group scheduled on the PMU. One consequence is that when you have a pinned event (say the watchdog) you can no longer have regular exclusive event(group)s. Inspired by the fact that !pinned events are considered less strict, allow !pinned,exclusive events to share the PMU with pinned,!exclusive events. Pinned,exclusive is still fully exclusive. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 2714c39 commit 1908dc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/events/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2637,7 +2637,7 @@ static int group_can_go_on(struct perf_event *event,
26372637
* If this group is exclusive and there are already
26382638
* events on the CPU, it can't go on.
26392639
*/
2640-
if (event->attr.exclusive && cpuctx->active_oncpu)
2640+
if (event->attr.exclusive && !list_empty(get_event_list(event)))
26412641
return 0;
26422642
/*
26432643
* Otherwise, try to add it if all previous groups were able

0 commit comments

Comments
 (0)