[RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable

From: Steven Rostedt
Date: Wed Jul 27 2005 - 09:15:35 EST


The following patch makes the MAX_RT_PRIO and MAX_USER_RT_PRIO
configurable from the make *config. This is more of a proposal since
I'm not really sure where in Kconfig this would best fit. I don't see
why these options shouldn't be user configurable without going into the
kernel headers to change them.

Also, is there a way in the Kconfig to force the checking of
MAX_USER_RT_PRIO <= MAX_RT_PRIO?

-- Steve

(Patched against 2.6.12.2)

Index: vanilla_kernel/include/linux/sched.h
===================================================================
--- vanilla_kernel/include/linux/sched.h (revision 263)
+++ vanilla_kernel/include/linux/sched.h (working copy)
@@ -389,9 +389,13 @@
* MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
*/

-#define MAX_USER_RT_PRIO 100
-#define MAX_RT_PRIO MAX_USER_RT_PRIO
+#define MAX_USER_RT_PRIO CONFIG_MAX_USER_RT_PRIO
+#define MAX_RT_PRIO CONFIG_MAX_RT_PRIO

+#if MAX_USER_RT_PRIO > MAX_RT_PRIO
+#error MAX_USER_RT_PRIO must not be greater than MAX_RT_PRIO
+#endif
+
#define MAX_PRIO (MAX_RT_PRIO + 40)

#define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO))
Index: vanilla_kernel/init/Kconfig
===================================================================
--- vanilla_kernel/init/Kconfig (revision 263)
+++ vanilla_kernel/init/Kconfig (working copy)
@@ -162,6 +162,32 @@
building a kernel for install/rescue disks or your system is very
limited in memory.

+config MAX_RT_PRIO
+ int "Maximum RT priority"
+ default 100
+ help
+ The real-time priority of threads that have the policy of SCHED_FIFO
+ or SCHED_RR have a priority higher than normal threads. This range
+ can be set here, where the range starts from 0 to MAX_RT_PRIO-1.
+ If this range is higher than MAX_USER_RT_PRIO than kernel threads
+ may have a higher priority than any user thread.
+
+ This may be the same as MAX_USER_RT_PRIO, but do not set this
+ to be less than MAX_USER_RT_PRIO.
+
+config MAX_USER_RT_PRIO
+ int "Maximum User RT priority"
+ default 100
+ help
+ The real-time priority of threads that have the policy of SCHED_FIFO
+ or SCHED_RR have a priority higher than normal threads. This range
+ can be set here, where the range starts from 0 to MAX_USER_RT_PRIO-1.
+ If this range is lower than MAX_RT_PRIO, than kernel threads may have
+ a higher priority than any user thread.
+
+ This may be the same as MAX_RT_PRIO, but do not set this to be
+ greater than MAX_RT_PRIO.
+
config AUDIT
bool "Auditing support"
default y if SECURITY_SELINUX


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/