[PATCH 2/2] sched: fix cpupri priocount

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>, Thomas Gleixner <tglx@...>, Steven Rostedt <rostedt@...>, Arnaldo Carvalho de Melo <acme@...>
Cc: Gregory Haskins <ghaskins@...>, <linux-kernel@...>, <linux-rt-users@...>, Peter Zijlstra <peterz@...>
Date: Wednesday, June 4, 2008 - 3:04 pm

A rounding error was pointed out by Peter Zijlstra which would result
in the structure holding priorities to be off by one.

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
CC: Peter Zijlstra <peterz@infradead.org>
---

 kernel/sched_cpupri.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched_cpupri.h b/kernel/sched_cpupri.h
index 16d29b9..817c55c 100644
--- a/kernel/sched_cpupri.h
+++ b/kernel/sched_cpupri.h
@@ -4,7 +4,7 @@
 #include <linux/sched.h>
 
 #define CPUPRI_NR_PRIORITIES 2+MAX_RT_PRIO
-#define CPUPRI_NR_PRI_WORDS CPUPRI_NR_PRIORITIES/BITS_PER_LONG
+#define CPUPRI_NR_PRI_WORDS (CPUPRI_NR_PRIORITIES + BITS_PER_LONG/2)/BITS_PER_LONG
 
 #define CPUPRI_INVALID -1
 #define CPUPRI_IDLE     0

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2] sched: hotplug and cpupri fixes (v2), Gregory Haskins, (Wed Jun 4, 3:03 pm)
[PATCH 2/2] sched: fix cpupri priocount, Gregory Haskins, (Wed Jun 4, 3:04 pm)
Re: [PATCH 2/2] sched: fix cpupri priocount, Peter Zijlstra, (Wed Jun 4, 5:09 pm)
Re: [PATCH 2/2] sched: fix cpupri priocount, Gregory Haskins, (Wed Jun 4, 5:52 pm)
RE: [PATCH 2/2] sched: fix cpupri priocount, Rune Torgersen, (Wed Jun 4, 5:35 pm)
[PATCH 1/2] sched: fix cpupri hotplug support, Gregory Haskins, (Wed Jun 4, 3:04 pm)