mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: eranian@gmail.com, linux-kernel@vger.kernel.org, mingo@elte.hu,
	paulus@samba.org, davem@davemloft.net, fweisbec@gmail.com,
	acme@infradead.org, ming.m.lin@intel.com,
	perfmon2-devel@lists.sf.net
Subject: Re: [PATCH] perf_events: fix event scheduling issues introduced by transactional API (take 2)
Date: Tue, 25 May 2010 18:18:35 +0200	[thread overview]
Message-ID: <1274804315.5882.1821.camel@twins> (raw)
In-Reply-To: <AANLkTilwlZKx0k-Z_6LHVXIM561JLcWV4mX4Wcwgb7r0@mail.gmail.com>

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)

  reply	other threads:[~2010-05-25 16:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25 13:20 Stephane Eranian
2010-05-25 13:35 ` Peter Zijlstra
2010-05-25 13:39   ` stephane eranian
2010-05-25 14:03     ` Peter Zijlstra
2010-05-25 14:19       ` Stephane Eranian
2010-05-25 15:02         ` Stephane Eranian
2010-05-25 15:32           ` Peter Zijlstra
2010-05-25 15:58             ` Peter Zijlstra
2010-05-25 16:10               ` Stephane Eranian
2010-05-25 16:18                 ` Peter Zijlstra [this message]
2010-05-25 16:20                   ` Stephane Eranian
2010-06-09 10:15               ` [tip:perf/core] perf: Cleanup {start,commit,cancel}_txn details tip-bot for Peter Zijlstra
2010-05-26  6:34             ` [PATCH] perf_events: fix event scheduling issues introduced by transactional API (take 2) Lin Ming
2010-05-26  6:58               ` Stephane Eranian
2010-05-31  7:20       ` [tip:perf/urgent] perf_events: Fix event scheduling issues introduced by transactional API tip-bot for Stephane Eranian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1274804315.5882.1821.camel@twins \
    --to=peterz@infradead.org \
    --cc=acme@infradead.org \
    --cc=davem@davemloft.net \
    --cc=eranian@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=perfmon2-devel@lists.sf.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®