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.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -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 already | 2637 | * 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 able | 2643 | * Otherwise, try to add it if all previous groups were able |