[PATCH v3 42/57] perf: Simplify perf_iterate_sb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
---
 kernel/events/core.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7871,8 +7871,8 @@ perf_iterate_sb(perf_iterate_f output, v
 {
 	struct perf_event_context *ctx;
 
-	rcu_read_lock();
-	preempt_disable();
+	guard(rcu)();
+	guard(preempt)();
 
 	/*
 	 * If we have task_ctx != NULL we only notify the task context itself.
@@ -7881,7 +7881,7 @@ perf_iterate_sb(perf_iterate_f output, v
 	 */
 	if (task_ctx) {
 		perf_iterate_ctx(task_ctx, output, data, false);
-		goto done;
+		return;
 	}
 
 	perf_iterate_sb_cpu(output, data);
@@ -7889,9 +7889,6 @@ perf_iterate_sb(perf_iterate_f output, v
 	ctx = rcu_dereference(current->perf_event_ctxp);
 	if (ctx)
 		perf_iterate_ctx(ctx, output, data, false);
-done:
-	preempt_enable();
-	rcu_read_unlock();
 }
 
 /*





[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux