public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lin Ming <ming.m.lin@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>,
	"eranian@gmail.com" <eranian@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"paulus@samba.org" <paulus@samba.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"fweisbec@gmail.com" <fweisbec@gmail.com>,
	"acme@infradead.org" <acme@infradead.org>,
	"perfmon2-devel@lists.sf.net" <perfmon2-devel@lists.sf.net>
Subject: Re: [PATCH] perf_events: fix event scheduling issues introduced by transactional API (take 2)
Date: Wed, 26 May 2010 14:34:18 +0800	[thread overview]
Message-ID: <1274855658.3429.24.camel@minggr.sh.intel.com> (raw)
In-Reply-To: <1274801531.5882.1670.camel@twins>

On Tue, 2010-05-25 at 23:32 +0800, Peter Zijlstra wrote:
> On Tue, 2010-05-25 at 17:02 +0200, Stephane Eranian wrote:
> > Ok, the patch look good expect it needs:
> > 
> > static int x86_pmu_commit_txn(const struct pmu *pmu)
> > {
> >         ......
> >         /*
> >          * copy new assignment, now we know it is possible
> >          * will be used by hw_perf_enable()
> >          */
> >         memcpy(cpuc->assign, assign, n*sizeof(int));
> > 
> >         cpuc->n_txn = 0;
> > 
> >         return 0;
> > }
> > 
> > Because you always call cancel_txn() even when commit()
> > succeeds. I don't really understand why. I think it could be
> > avoided by clearing the group_flag in commit_txn() if it
> > succeeds. It would also make the logical flow more natural. Why
> > cancel something that has succeeded. You cancel when you fail/abort.
> 
> Gah, I forgot about that. I think I suggested to Lin to do that and then
> promptly forgot.

cancel_txn() clears the transaction flag, so it is needed after both
success and fail transaction, although the function name is a bit
misleading.

Peter's patch adds the clear of transaction flag into each
implementation of ->commit_txn.

So cancel_txn() is only called after fail transaction now.

Thanks,
Lin Ming

> 
> Let me add that and at least push this patch fwd, we can try and clean
> up that detail later on.


  parent reply	other threads:[~2010-05-26  6:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25 13:20 [PATCH] perf_events: fix event scheduling issues introduced by transactional API (take 2) 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
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             ` Lin Ming [this message]
2010-05-26  6:58               ` [PATCH] perf_events: fix event scheduling issues introduced by transactional API (take 2) 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=1274855658.3429.24.camel@minggr.sh.intel.com \
    --to=ming.m.lin@intel.com \
    --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=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=perfmon2-devel@lists.sf.net \
    --cc=peterz@infradead.org \
    /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