[PATCH 2/2] sched: fix cpupri priocount

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gregory Haskins
Date: Wednesday, June 4, 2008 - 12: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, 12:03 pm)
[PATCH 1/2] sched: fix cpupri hotplug support, Gregory Haskins, (Wed Jun 4, 12:04 pm)
[PATCH 2/2] sched: fix cpupri priocount, Gregory Haskins, (Wed Jun 4, 12:04 pm)
Re: [PATCH 2/2] sched: fix cpupri priocount, Peter Zijlstra, (Wed Jun 4, 2:09 pm)
RE: [PATCH 2/2] sched: fix cpupri priocount, Rune Torgersen, (Wed Jun 4, 2:35 pm)
Re: [PATCH 2/2] sched: fix cpupri priocount, Gregory Haskins, (Wed Jun 4, 2:52 pm)