mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Stephane Eranian <eranian@frankl.hpl.hp.com>
Cc: linux-kernel@vger.kernel.org, eranian@hpl.hp.com
Subject: Re: [PATCH 7/18] 2.6.17.9 perfmon2 patch for review: PMU interruption support
Date: Wed, 23 Aug 2006 15:40:57 -0700	[thread overview]
Message-ID: <20060823154057.4d6d444b.akpm@osdl.org> (raw)
In-Reply-To: <200608230805.k7N85wQc000420@frankl.hpl.hp.com>

On Wed, 23 Aug 2006 01:05:58 -0700
Stephane Eranian <eranian@frankl.hpl.hp.com> wrote:

> ...
>
> +irqreturn_t pfm_interrupt_handler(int irq, void *arg, struct pt_regs *regs)
> +{
> +	u64 start_cycles, total_cycles;
> +
> +	get_cpu();
> +
> +	start_cycles = pfm_arch_get_itc();
> +
> +	__pfm_interrupt_handler(regs);
> +
> +	total_cycles = pfm_arch_get_itc();
> +
> +	__get_cpu_var(pfm_stats).pfm_ovfl_intr_cycles += total_cycles - start_cycles;
> +
> +	put_cpu_no_resched();
> +	return IRQ_HANDLED;
> +}

If this code is only ever called from interrupt context then I suspect the
get_cpu() is not needed.  __get_cpu_var() requires that preemption be
disabled (so we cannot wander over to a different CPU midway) but IRQ
code doesn't get preempted.


  reply	other threads:[~2006-08-23 22:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-23  8:05 Stephane Eranian
2006-08-23 22:40 ` Andrew Morton [this message]
2006-08-28 15:24   ` Stephane Eranian

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=20060823154057.4d6d444b.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=eranian@frankl.hpl.hp.com \
    --cc=eranian@hpl.hp.com \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®