All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Clark Williams <williams@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-rt-users@vger.kernel.org
Subject: [PATCH tip/rt/head] perf: Mark software events as irqsafe
Date: Mon, 18 Oct 2010 16:38:43 -0200	[thread overview]
Message-ID: <20101018183843.GA22254@ghostprotocols.net> (raw)

From: Peter Zijlstra <peterz@infradead.org>

Noticed while using 'perf top' on a machine without a supported PMU on
2.6.33.7-rt29, when top falls back to using the "cpu-clock" software
event.

Reproduced on other machines where the problem was masked due to the
existence and use of hardware events, by explicitely asking for a
software event using:

perf top -e cpu-clock

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@infradead.org>

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 6dfaf5b..b9fbc17 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4238,6 +4238,7 @@ static void perf_swevent_start_hrtimer(struct perf_event *event)
 	struct hw_perf_event *hwc = &event->hw;
 
 	hrtimer_init(&hwc->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hwc->hrtimer.irqsafe = 1;
 	hwc->hrtimer.function = perf_swevent_hrtimer;
 	if (hwc->sample_period) {
 		u64 period;

                 reply	other threads:[~2010-10-18 19:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20101018183843.GA22254@ghostprotocols.net \
    --to=acme@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.