lkml.org 
[lkml]   [2009]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/7] perf_counter: fix dynamic irq_period logging
We call perf_adjust_freq() from perf_counter_task_tick() which is is called
under the rq->lock causing lock recursion. However, it's no longer required
to be called under the rq->lock, so remove it from under it.

Also, fix up some related comments.

LKML-Reference: <new-submission>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/perf_counter.h | 1 +
kernel/perf_counter.c | 3 ++-
kernel/sched.c | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)

Index: linux-2.6/include/linux/perf_counter.h
===================================================================
--- linux-2.6.orig/include/linux/perf_counter.h
+++ linux-2.6/include/linux/perf_counter.h
@@ -260,6 +260,7 @@ enum perf_event_type {
/*
* struct {
* struct perf_event_header header;
+ * u64 time;
* u64 irq_period;
* };
*/
Index: linux-2.6/kernel/perf_counter.c
===================================================================
--- linux-2.6.orig/kernel/perf_counter.c
+++ linux-2.6/kernel/perf_counter.c
@@ -2559,7 +2559,8 @@ void perf_counter_munmap(unsigned long a
}

/*
- *
+ * Log irq_period changes so that analyzing tools can re-normalize the
+ * event flow.
*/

static void perf_log_period(struct perf_counter *counter, u64 period)
Index: linux-2.6/kernel/sched.c
===================================================================
--- linux-2.6.orig/kernel/sched.c
+++ linux-2.6/kernel/sched.c
@@ -5113,9 +5113,10 @@ void scheduler_tick(void)
update_rq_clock(rq);
update_cpu_load(rq);
curr->sched_class->task_tick(rq, curr, 0);
- perf_counter_task_tick(curr, cpu);
spin_unlock(&rq->lock);

+ perf_counter_task_tick(curr, cpu);
+
#ifdef CONFIG_SMP
rq->idle_at_tick = idle_cpu(cpu);
trigger_load_balance(rq, cpu);
--



\
 
 \ /
  Last update: 2009-05-23 18:35    [W:0.111 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site