From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@kernel.org>,
mingo@redhat.com, Paul Mackerras <paulus@samba.org>,
dev@codyps.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 1/5] perf: Add a flags parameter to pmu txn interfaces
Date: Wed, 8 Apr 2015 08:40:54 -0700 [thread overview]
Message-ID: <20150408154054.GA3525@us.ibm.com> (raw)
In-Reply-To: <20150408121923.GD23123@twins.programming.kicks-ass.net>
Peter Zijlstra [peterz@infradead.org] wrote:
| On Tue, Apr 07, 2015 at 05:34:55PM -0700, Sukadev Bhattiprolu wrote:
| > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
| > index 2b62198..4dc3d70 100644
| > --- a/include/linux/perf_event.h
| > +++ b/include/linux/perf_event.h
| > @@ -240,20 +240,27 @@ struct pmu {
| > *
| > * Start the transaction, after this ->add() doesn't need to
| > * do schedulability tests.
| > + *
| > + * Optional.
| > */
| > - void (*start_txn) (struct pmu *pmu); /* optional */
| > +#define PERF_PMU_TXN_ADD 0x1 /* txn to add/schedule event on PMU */
|
| Please do not interleave these flags in the structure. Maybe place it
| near PERF_EVENT_TXN.
Ok.
|
| > + void (*start_txn) (struct pmu *pmu, int flags);
| > /*
| > * If ->start_txn() disabled the ->add() schedulability test
| > * then ->commit_txn() is required to perform one. On success
| > * the transaction is closed. On error the transaction is kept
| > * open until ->cancel_txn() is called.
| > + *
| > + * Optional.
| > */
| > - int (*commit_txn) (struct pmu *pmu); /* optional */
| > + int (*commit_txn) (struct pmu *pmu, int flags);
| > /*
| > * Will cancel the transaction, assumes ->del() is called
| > * for each successful ->add() during the transaction.
| > + *
| > + * Optional.
| > */
| > - void (*cancel_txn) (struct pmu *pmu); /* optional */
| > + void (*cancel_txn) (struct pmu *pmu, int flags);
| >
| > /*
| > * Will return the value for perf_event_mmap_page::index for this event,
|
| So (again), why also pass the flags to cancel/commit ?
|
| The transaction state _has_ to already record it, otherwise it doesn't
| know if add/read are part of one.
I had replied to your earlier mail and added a Note to this patch
description. I was hesitating making more intrusive changes to PMUs
that don't care about the new txn type.
But, I agree, it is better to go ahead and update all PMUs to save
the state and check. Will do that in the next version.
Sukadev
next prev parent reply other threads:[~2015-04-16 17:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 0:34 [PATCH v2 0/5] perf: Implement event group read using txn interface Sukadev Bhattiprolu
2015-04-08 0:34 ` [PATCH v2 1/5] perf: Add a flags parameter to pmu txn interfaces Sukadev Bhattiprolu
2015-04-08 12:19 ` Peter Zijlstra
2015-04-08 15:40 ` Sukadev Bhattiprolu [this message]
2015-04-08 0:34 ` [PATCH v2 2/5] perf: Split perf_event_read() and perf_event_count() Sukadev Bhattiprolu
2015-04-08 0:34 ` [PATCH v2 3/5] perf: Rename perf_event_read_value Sukadev Bhattiprolu
2015-04-08 12:24 ` Peter Zijlstra
2015-04-08 0:34 ` [PATCH v2 4/5] perf: Define PMU_TXN_READ interface Sukadev Bhattiprolu
2015-04-08 12:45 ` Peter Zijlstra
2015-04-09 19:10 ` Sukadev Bhattiprolu
2015-04-08 0:34 ` [PATCH v2 5/5] powerpc/perf/hv-24x7: Use " Sukadev Bhattiprolu
2015-04-08 12:51 ` Peter Zijlstra
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=20150408154054.GA3525@us.ibm.com \
--to=sukadev@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=dev@codyps.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--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;
as well as URLs for NNTP newsgroup(s).