lkml.org 
[lkml]   [2010]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] perf_event: Make software events work again
Commit 6bde9b6ce0127e2a56228a2071536d422be31336 ("perf: Add group
scheduling transactional APIs") added code to allow a group to be
scheduled in a single transaction. However, it introduced a bug in
handling events whose pmu does not implement transactions -- at the
end of scheduling in the events in the group, in the non-transactional
case the code now falls through to the group_error label, and proceeds
to unschedule all the events in the group and return failure.

This fixes it by returning 0 (success) in the non-transactional case.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index bb06382..180151f 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -664,13 +664,13 @@ group_sched_in(struct perf_event *group_event,
}
}

- if (txn) {
- ret = pmu->commit_txn(pmu);
- if (!ret) {
- pmu->cancel_txn(pmu);
+ if (!txn)
+ return 0;

- return 0;
- }
+ ret = pmu->commit_txn(pmu);
+ if (!ret) {
+ pmu->cancel_txn(pmu);
+ return 0;
}

group_error:

\
 
 \ /
  Last update: 2010-05-08 13:01    [W:0.058 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site