From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Robert Richter <robert.richter@amd•com>
Cc: linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
Matt Fleming <matt@console-pimps•org>,
Thomas Gleixner <tglx@linutronix•de>, Ingo Molnar <mingo@elte•hu>,
"H. Peter Anvin" <hpa@zytor•com>,
Peter Zijlstra <peterz@infradead•org>
Subject: linux-next: manual merge of the oprofile tree with the tip tree
Date: Tue, 12 Oct 2010 13:13:59 +1100 [thread overview]
Message-ID: <20101012131359.5ade7129.sfr@canb.auug.org.au> (raw)
Hi Robert,
Today's linux-next merge of the oprofile tree got a conflict in
kernel/perf_event.c between commit
33696fc0d141bbbcb12f75b69608ea83282e3117 ("perf: Per PMU disable") from
the tip tree and commit 84c7991059c9c4530cc911137c5bf508a41ed129 ("perf:
New helper function for pmu name") from the oprofile tree.
Just context changes. I fixed it up (see below) and can carry the fix as
necessary.
--
Cheers,
Stephen Rothwell sfr@canb•auug.org.au
diff --cc kernel/perf_event.c
index 64507ea,fc51268..0000000
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@@ -61,38 -67,41 +61,43 @@@ int sysctl_perf_event_sample_rate __rea
static atomic64_t perf_event_id;
-/*
- * Lock for (sysadmin-configurable) event reservations:
- */
-static DEFINE_SPINLOCK(perf_resource_lock);
+void __weak perf_event_print_debug(void) { }
-/*
- * Architecture provided APIs - weak aliases:
- */
-extern __weak const struct pmu *hw_perf_event_init(struct perf_event *event)
+void perf_pmu_disable(struct pmu *pmu)
{
- return NULL;
+ int *count = this_cpu_ptr(pmu->pmu_disable_count);
+ if (!(*count)++)
+ pmu->pmu_disable(pmu);
}
-void __weak hw_perf_disable(void) { barrier(); }
-void __weak hw_perf_enable(void) { barrier(); }
-
-void __weak perf_event_print_debug(void) { }
-
+ extern __weak const char *perf_pmu_name(void)
+ {
+ return "pmu";
+ }
+
-static DEFINE_PER_CPU(int, perf_disable_count);
-
-void perf_disable(void)
+void perf_pmu_enable(struct pmu *pmu)
{
- if (!__get_cpu_var(perf_disable_count)++)
- hw_perf_disable();
+ int *count = this_cpu_ptr(pmu->pmu_disable_count);
+ if (!--(*count))
+ pmu->pmu_enable(pmu);
}
-void perf_enable(void)
+static DEFINE_PER_CPU(struct list_head, rotation_list);
+
+/*
+ * perf_pmu_rotate_start() and perf_rotate_context() are fully serialized
+ * because they're strictly cpu affine and rotate_start is called with IRQs
+ * disabled, while rotate_context is called from IRQ context.
+ */
+static void perf_pmu_rotate_start(struct pmu *pmu)
{
- if (!--__get_cpu_var(perf_disable_count))
- hw_perf_enable();
+ struct perf_cpu_context *cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
+ struct list_head *head = &__get_cpu_var(rotation_list);
+
+ WARN_ON(!irqs_disabled());
+
+ if (list_empty(&cpuctx->rotation_list))
+ list_add(&cpuctx->rotation_list, head);
}
static void get_ctx(struct perf_event_context *ctx)
next reply other threads:[~2010-10-12 2:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-12 2:13 Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-03-21 5:31 linux-next: manual merge of the oprofile tree with the tip tree Stephen Rothwell
2012-03-21 12:33 ` Robert Richter
2012-03-21 13:52 ` Stephen Rothwell
2012-03-13 6:37 Stephen Rothwell
2012-03-13 8:31 ` Ingo Molnar
2010-10-12 2:18 Stephen Rothwell
2010-10-12 6:03 ` Matt Fleming
2010-10-12 12:23 ` Stephen Rothwell
2010-10-12 12:51 ` Matt Fleming
2010-10-15 12:43 ` Robert Richter
2010-10-01 3:53 Stephen Rothwell
2010-10-01 13:21 ` Robert Richter
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=20101012131359.5ade7129.sfr@canb.auug.org.au \
--to=sfr@canb$(echo .)auug.org.au \
--cc=hpa@zytor$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=matt@console-pimps$(echo .)org \
--cc=mingo@elte$(echo .)hu \
--cc=peterz@infradead$(echo .)org \
--cc=robert.richter@amd$(echo .)com \
--cc=tglx@linutronix$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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