Re: [PATCH] perf_events: fix event scheduling issues introduced by transactional API (take 2)

From: Stephane Eranian
Date: Tue May 25 2010 - 12:10:17 EST


> Index: linux-2.6/kernel/perf_event.c
> ===================================================================
> --- linux-2.6.orig/kernel/perf_event.c
> +++ linux-2.6/kernel/perf_event.c
> @@ -668,15 +668,9 @@ group_sched_in(struct perf_event *group_
> Â Â Â Â Â Â Â Â}
> Â Â Â Â}
>
> - Â Â Â if (!txn)
> + Â Â Â if (!txn || !pmu->commit_txn(pmu))
> Â Â Â Â Â Â Â Âreturn 0;
>
> - Â Â Â ret = pmu->commit_txn(pmu);
> - Â Â Â if (!ret) {
> - Â Â Â Â Â Â Â pmu->cancel_txn(pmu);
> - Â Â Â Â Â Â Â return 0;
> - Â Â Â }
> -
> Âgroup_error:
> Â Â Â Â/*
> Â Â Â Â * Groups can be scheduled in as one unit only, so undo any
>
Looks okay.

I believe you can also drop the txn test in group_sched_in() after group_error:,
given you have the if !(txn) return 0.
N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i