lkml.org 
[lkml]   [2010]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] perf_events: fix event scheduling issues introduced by transactional API (take 2)
From
Date
On Tue, 2010-05-25 at 18:10 +0200, Stephane Eranian wrote:
> > 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.

Can't we still get in the group_error: branch with either scenario?

!txn will get there if ->enable() of a group sibling fails,
txn will get there if either ->enable() or ->commit_txn() fails.

(Although typically ->enable() would not fail for txn)


\
 
 \ /
  Last update: 2010-05-25 18:21    [W:0.173 / U:1.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site