History

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.

Peter Zijlstra committed 6 years ago

Commit 1908dc91 parent 2714c391 file · +1 −1Browse files

Unified · Split

kernel/events/core.c+1−1
@@ -2637,7 +2637,7 @@ static int group_can_go_on(struct perf_event *event, · 2636 unmodified lines
2637 * If this group is exclusive and there are already2637 * If this group is exclusive and there are already
2638 * events on the CPU, it can't go on.2638 * events on the CPU, it can't go on.
2639 */2639 */
2640 if (event->attr.exclusive && cpuctx->active_oncpu)2640 if (event->attr.exclusive && !list_empty(get_event_list(event)))
2641 return 0;2641 return 0;
2642 /*2642 /*
2643 * Otherwise, try to add it if all previous groups were able2643 * Otherwise, try to add it if all previous groups were able

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t