From: Pingfan Liu <kernelfans@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
Omar Sandoval <osandov@fb.com>,
Andrew Morton <akpm@linux-foundation.org>,
Mike Rapoport <rppt@kernel.org>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<x86@kernel.org>
Subject: Re: [PATCH 1/2] events/core: introduce perf_pmu_disable_all() to turn off all PMU
Date: Tue, 24 Nov 2020 16:50:45 +0800 [thread overview]
Message-ID: <CAFgQCTvJXtWY21CUzOT5=_RYNF-r1kWm-uE10TbPCNcaaxH2SA@mail.gmail.com> (raw)
In-Reply-To: <20201123140552.GN3021@hirez.programming.kicks-ass.net>
On Mon, Nov 23, 2020 at 10:05 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Mon, Nov 23, 2020 at 01:37:25PM +0800, Pingfan Liu wrote:
>
> > +/* When crashed, other cpus hang in idle loop, so here do an emergency job under no lock */
>
> -ENOPARSE, -ETOOLONG
>
> > +void perf_pmu_disable_all(void)
> > +{
> > + struct pmu *pmu;
> > +
> > + list_for_each_entry(pmu, &pmus, entry)
> > + if (pmu->pmu_disable)
> > + pmu->pmu_disable(pmu);
> > +}
>
> This violates both locking rules and coding style.
Oops. I will re-work on it to see how to run it safely on crashed context.
Thanks,
Pingfan
prev parent reply other threads:[~2020-11-24 8:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-23 5:37 [PATCH 1/2] events/core: introduce perf_pmu_disable_all() to turn off all PMU Pingfan Liu
2020-11-23 5:37 ` [PATCH 2/2] x86/machine_kexec: disable PMU before jumping to new kernel Pingfan Liu
2020-11-26 8:05 ` Pingfan Liu
2020-11-23 14:05 ` [PATCH 1/2] events/core: introduce perf_pmu_disable_all() to turn off all PMU Peter Zijlstra
2020-11-24 8:50 ` Pingfan Liu [this message]
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='CAFgQCTvJXtWY21CUzOT5=_RYNF-r1kWm-uE10TbPCNcaaxH2SA@mail.gmail.com' \
--to=kernelfans@gmail.com \
--cc=acme@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=osandov@fb.com \
--cc=peterz@infradead.org \
--cc=rppt@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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).