public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] perf_counter: frequency based adaptive irq_period
Date: Fri, 15 May 2009 15:37:47 +0200	[thread overview]
Message-ID: <1242394667.6642.1887.camel@laptop> (raw)
In-Reply-To: <20090515132018.646195868@chello.nl>

On Fri, 2009-05-15 at 15:19 +0200, Peter Zijlstra wrote:
> plain text document attachment (perf_counter-freq.patch)
> Instead of specifying the irq_period for a counter, provide a target interrupt
> frequency and dynamically adapt the irq_period to match this frequency.
> 
> Paul, please verify ppc64, I only did a very quick pass over that code.
> 
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Corey Ashford <cjashfor@linux.vnet.ibm.com>
> ---

> @@ -2907,6 +2940,12 @@ perf_counter_alloc(struct perf_counter_h
>  
>  	pmu = NULL;
>  
> +	hwc = &counter->hw;
> +	if (hw_event->freq && hw_event->irq_freq)
> +		hwc->irq_period = TICK_NSEC / hw_event->irq_freq;
> +	else
> +		hwc->irq_period = hw_event->irq_period;
> +



kernel/built-in.o: In function `perf_counter_alloc':
perf_counter.c:(.text+0x7ddc7): undefined reference to `__udivdi3'

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---

Index: linux-2.6/kernel/perf_counter.c
===================================================================
--- linux-2.6.orig/kernel/perf_counter.c
+++ linux-2.6/kernel/perf_counter.c
@@ -2942,7 +2942,7 @@ perf_counter_alloc(struct perf_counter_h
 
 	hwc = &counter->hw;
 	if (hw_event->freq && hw_event->irq_freq)
-		hwc->irq_period = TICK_NSEC / hw_event->irq_freq;
+		hwc->irq_period = div64_u64(TICK_NSEC, hw_event->irq_freq);
 	else
 		hwc->irq_period = hw_event->irq_period;
 



  parent reply	other threads:[~2009-05-15 13:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-15 13:19 [PATCH 0/4] perf-counter bits Peter Zijlstra
2009-05-15 13:19 ` [PATCH 1/4] perf_counter: remove perf_disable/enable exports Peter Zijlstra
2009-05-15 14:43   ` [tip:perfcounters/core] " tip-bot for Peter Zijlstra
2009-05-15 13:19 ` [PATCH 2/4] perf_counter: per user mlock gift Peter Zijlstra
2009-05-15 14:43   ` [tip:perfcounters/core] " tip-bot for Peter Zijlstra
2009-05-15 13:19 ` [PATCH 3/4] perf_counter: frequency based adaptive irq_period Peter Zijlstra
2009-05-15 13:35   ` Ingo Molnar
2009-05-15 13:37   ` Peter Zijlstra [this message]
2009-05-15 14:43     ` [tip:perfcounters/core] perf_counter: frequency based adaptive irq_period, 32-bit fix tip-bot for Peter Zijlstra
2009-05-15 14:43   ` [tip:perfcounters/core] perf_counter: frequency based adaptive irq_period tip-bot for Peter Zijlstra
2009-05-15 13:19 ` [PATCH 4/4] perf_counter: update perf-top to use the new freq interface Peter Zijlstra
2009-05-15 13:33   ` Ingo Molnar
2009-05-15 14:43   ` [tip:perfcounters/core] perf top: update " tip-bot for Peter Zijlstra

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=1242394667.6642.1887.camel@laptop \
    --to=a.p.zijlstra@chello.nl \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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