From: Michael Ellerman <mpe@ellerman.id.au>
To: Anshuman Khandual <khandual@linux.vnet.ibm.com>, linuxppc-dev@ozlabs.org
Cc: mikey@neuling.org, sukadev@linux.vnet.ibm.com, dja@axtens.net
Subject: Re: [3/5] powerpc/perf: Replace last usage of get_cpu_var with this_cpu_ptr
Date: Mon, 27 Jul 2015 15:15:30 +1000 (AEST) [thread overview]
Message-ID: <20150727051530.325AE1402C6@ozlabs.org> (raw)
In-Reply-To: <1435652431-22024-4-git-send-email-khandual@linux.vnet.ibm.com>
On Tue, 2015-30-06 at 08:20:29 UTC, Anshuman Khandual wrote:
> The commit 69111bac42f5ce ("powerpc: Replace __get_cpu_var uses")
> replaced all usage of get_cpu_var with this_cpu_ptr inside core
> perf event handling on powerpc. But it skipped one of them which
> is being replaced with this patch.
No it replaced all uses of __get_cpu_var(), not get_cpu_var(). The difference
is important.
get_cpu_var() disables preemption for you, so it's only safe to switch to
this_cpu_ptr() if preemption is already disabled. Is it?
cheers
> diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
> index f9ecd93..57f2c78 100644
> --- a/arch/powerpc/perf/core-book3s.c
> +++ b/arch/powerpc/perf/core-book3s.c
> @@ -1840,20 +1840,17 @@ static int power_pmu_event_init(struct perf_event *event)
> if (check_excludes(ctrs, cflags, n, 1))
> return -EINVAL;
>
> - cpuhw = &get_cpu_var(cpu_hw_events);
> + cpuhw = this_cpu_ptr(&cpu_hw_events);
> err = power_check_constraints(cpuhw, events, cflags, n + 1);
>
> if (has_branch_stack(event)) {
> cpuhw->bhrb_filter = ppmu->bhrb_filter_map(
> event->attr.branch_sample_type);
>
> - if (cpuhw->bhrb_filter == -1) {
> - put_cpu_var(cpu_hw_events);
> + if (cpuhw->bhrb_filter == -1)
> return -EOPNOTSUPP;
> - }
> }
>
> - put_cpu_var(cpu_hw_events);
> if (err)
> return -EINVAL;
next prev parent reply other threads:[~2015-07-27 5:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-30 8:20 [PATCH 0/5] BHRB fixes, improvements and cleanups Anshuman Khandual
2015-06-30 8:20 ` [PATCH 1/5] powerpc/perf: Drop the branch sample when 'from' cannot be fetched Anshuman Khandual
2015-07-27 4:19 ` [1/5] " Michael Ellerman
2015-07-28 3:08 ` Anshuman Khandual
2015-09-30 9:03 ` Anshuman Khandual
2015-09-30 10:46 ` Michael Ellerman
2015-06-30 8:20 ` [PATCH 2/5] powerpc/perf: Change type of the bhrb_users variable Anshuman Khandual
2015-08-03 1:35 ` [2/5] " Michael Ellerman
2015-06-30 8:20 ` [PATCH 3/5] powerpc/perf: Replace last usage of get_cpu_var with this_cpu_ptr Anshuman Khandual
2015-07-27 5:15 ` Michael Ellerman [this message]
2015-07-28 3:37 ` [3/5] " Anshuman Khandual
2015-06-30 8:20 ` [PATCH 4/5] powerpc/perf: Change name & type of 'pred' in power_pmu_bhrb_read Anshuman Khandual
2015-07-29 3:25 ` [4/5] " Michael Ellerman
2015-07-29 8:13 ` Anshuman Khandual
2015-06-30 8:20 ` [PATCH 5/5] powerpc/perf: Re organize PMU branch filter processing on POWER8 Anshuman Khandual
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=20150727051530.325AE1402C6@ozlabs.org \
--to=mpe@ellerman.id.au \
--cc=dja@axtens.net \
--cc=khandual@linux.vnet.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=sukadev@linux.vnet.ibm.com \
/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).