Skip to contentSkip to conversation

timer-2.5.40-F7

PATCH Oleg Nesterov 1 participant 1 message Oct 3, 2002

lore
Share & tools
lore
#0 lore raw

Hello.

run_timer_tasklet() checks for expired local timers, i think it is better to do it in run_local_timers() before tasklet_schedule().

On top of timer-2.5.40-F7:

timer.c renamed from timer.c.orig +8 -6
@@ -715,10 +715,7 @@
  */
 static void run_timer_tasklet(unsigned long data)
 {
-	tvec_base_t *base = tvec_bases + smp_processor_id();
-
-	if ((long)(jiffies - base->timer_jiffies) >= 0)
-		__run_timers(base);
+	__run_timers((tvec_base_t*)data);
 }
 
 /*
@@ -726,7 +723,11 @@
  */
 void run_local_timers(void)
 {
-	tasklet_hi_schedule(&per_cpu(timer_tasklet, smp_processor_id()));
+	int cpu = smp_processor_id();
+	tvec_base_t *base = tvec_bases + cpu;
+
+	if ((long)(jiffies - base->timer_jiffies) >= 0)
+		tasklet_hi_schedule(&per_cpu(timer_tasklet, cpu));
 }
 
 /*
@@ -1079,6 +1080,7 @@
 		}
 		for (j = 0; j < TVR_SIZE; j++)
 			INIT_LIST_HEAD(base->tv1.vec + j);
-		tasklet_init(&per_cpu(timer_tasklet, i), run_timer_tasklet, 0);
+		tasklet_init(&per_cpu(timer_tasklet, i),
+			run_timer_tasklet, (unsigned long)base);
 	}
 }