patch-2.4.0-test5 linux/kernel/sched.c

Next file: linux/kernel/sys.c
Previous file: linux/kernel/ksyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test4/linux/kernel/sched.c linux/kernel/sched.c
@@ -54,18 +54,19 @@
  * calculation depends on the value of HZ.
  */
 #if HZ < 200
-#define LOG2_HZ 7
+#define TICK_SCALE(x)	((x) >> 2)
 #elif HZ < 400
-#define LOG2_HZ 8
+#define TICK_SCALE(x)	((x) >> 1)
 #elif HZ < 800
-#define LOG2_HZ 9
+#define TICK_SCALE(x)	(x)
 #elif HZ < 1600
-#define LOG2_HZ 10
+#define TICK_SCALE(x)	((x) << 1)
 #else
-#define LOG2_HZ 11
+#define TICK_SCALE(x)	((x) << 2)
 #endif
 
-#define NICE_TO_TICKS(nice)	((((20)-(nice)) >> (LOG2_HZ-5))+1)
+#define NICE_TO_TICKS(nice)	(TICK_SCALE(20-(nice))+1)
+
 
 /*
  *	Init task must be ok at boot for the ix86 as we will check its signals
@@ -105,7 +106,7 @@
 #define cpu_curr(cpu) aligned_data[(cpu)].schedule_data.curr
 #define last_schedule(cpu) aligned_data[(cpu)].schedule_data.last_schedule
 
-struct kernel_stat kstat = { 0 };
+struct kernel_stat kstat;
 
 #ifdef CONFIG_SMP
 
@@ -209,8 +210,11 @@
  * We enter with the runqueue spinlock held, but we might end
  * up unlocking it early, so the caller must not unlock the
  * runqueue, it's always done by reschedule_idle().
+ *
+ * This function must be inline as anything that saves and restores
+ * flags has to do so within the same register window on sparc (Anton)
  */
-static void reschedule_idle(struct task_struct * p, unsigned long flags)
+static inline void reschedule_idle(struct task_struct * p, unsigned long flags)
 {
 #ifdef CONFIG_SMP
 	int this_cpu = smp_processor_id();
@@ -766,7 +770,6 @@
 {
 	__wake_up_common(q, mode, 1);
 }
-
 
 #define	SLEEP_ON_VAR				\
 	unsigned long flags;			\

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)