|
|
@@ -1524,6 +1524,11 @@ static void perf_remove_from_context(struct perf_event *event, bool detach_group
|
|
|
*/
|
|
|
if (ctx->is_active) {
|
|
|
raw_spin_unlock_irq(&ctx->lock);
|
|
|
+ /*
|
|
|
+ * Reload the task pointer, it might have been changed by
|
|
|
+ * a concurrent perf_event_context_sched_out().
|
|
|
+ */
|
|
|
+ task = ctx->task;
|
|
|
goto retry;
|
|
|
}
|
|
|
|
|
|
@@ -1967,6 +1972,11 @@ perf_install_in_context(struct perf_event_context *ctx,
|
|
|
*/
|
|
|
if (ctx->is_active) {
|
|
|
raw_spin_unlock_irq(&ctx->lock);
|
|
|
+ /*
|
|
|
+ * Reload the task pointer, it might have been changed by
|
|
|
+ * a concurrent perf_event_context_sched_out().
|
|
|
+ */
|
|
|
+ task = ctx->task;
|
|
|
goto retry;
|
|
|
}
|
|
|
|