We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 734df5a commit 06f4179Copy full SHA for 06f4179
kernel/events/core.c
@@ -1950,7 +1950,16 @@ static int __perf_event_enable(void *info)
1950
struct perf_cpu_context *cpuctx = __get_cpu_context(ctx);
1951
int err;
1952
1953
- if (WARN_ON_ONCE(!ctx->is_active))
+ /*
1954
+ * There's a time window between 'ctx->is_active' check
1955
+ * in perf_event_enable function and this place having:
1956
+ * - IRQs on
1957
+ * - ctx->lock unlocked
1958
+ *
1959
+ * where the task could be killed and 'ctx' deactivated
1960
+ * by perf_event_exit_task.
1961
+ */
1962
+ if (!ctx->is_active)
1963
return -EINVAL;
1964
1965
raw_spin_lock(&ctx->lock);
0 commit comments