[patch] sched_clock: fix preempt count imbalance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Ingo Molnar <[email protected]> wrote:

> > > please send me your current sched-clock.c, i'll redo any remaining 
> > > cleanups.
> > 
> > It needs at least one new preliminary patch (to add on_cpu_single);
> > please get the series from 
> > ftp://ftp.firstfloor.org/pub/ak/x86_64/quilt/patches-2.6.22-rc2-git7-070525-1.tar.gz
> > You need at least tsc-unstable upto paravirt-add-a-sched_clock-paravirt
> > for everything
> 
> thanks.
> 
> you missed one patch: please pick up the NUMAQ change i did too. (i 
> kept the printk to make sure someone notices that and actually tests 
> thing - i dont have a NUMAQ machine to try this on.)
> 
> i'm looking at the other things now.

you introduced a crash-bug via your cleanups - the patch below fixes it.

	Ingo

----------------------------->
Subject: [patch] sched_clock: fix preempt count imbalance
From: Ingo Molnar <[email protected]>

fix preempt count imbalance.

Signed-off-by: Ingo Molnar <[email protected]>
---
 arch/i386/kernel/sched-clock.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: linux-cfs-2.6.22-rc2-mm1.q/arch/i386/kernel/sched-clock.c
===================================================================
--- linux-cfs-2.6.22-rc2-mm1.q.orig/arch/i386/kernel/sched-clock.c
+++ linux-cfs-2.6.22-rc2-mm1.q/arch/i386/kernel/sched-clock.c
@@ -164,7 +164,10 @@ static int sc_freq_event(struct notifier
 			 void *data)
 {
 	struct cpufreq_freqs *freq = data;
-	struct sc_data *sc = &per_cpu(sc_data, freq->cpu);
+	struct sc_data *sc;
+
+	preempt_disable();
+	sc = &per_cpu(sc_data, freq->cpu);
 
 	if (cpu_has(&cpu_data[freq->cpu], X86_FEATURE_CONSTANT_TSC))
 		goto out;
@@ -194,7 +197,8 @@ static int sc_freq_event(struct notifier
 		break;
 	}
 out:
-	put_cpu();
+	preempt_enable();
+
 	return NOTIFY_DONE;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux