@@ -533,30 +533,6 @@ static int calc_wheel_index(unsigned long expires, unsigned long clk,
533
533
return idx ;
534
534
}
535
535
536
- /*
537
- * Enqueue the timer into the hash bucket, mark it pending in
538
- * the bitmap and store the index in the timer flags.
539
- */
540
- static void enqueue_timer (struct timer_base * base , struct timer_list * timer ,
541
- unsigned int idx )
542
- {
543
- hlist_add_head (& timer -> entry , base -> vectors + idx );
544
- __set_bit (idx , base -> pending_map );
545
- timer_set_idx (timer , idx );
546
-
547
- trace_timer_start (timer , timer -> expires , timer -> flags );
548
- }
549
-
550
- static void
551
- __internal_add_timer (struct timer_base * base , struct timer_list * timer ,
552
- unsigned long * bucket_expiry )
553
- {
554
- unsigned int idx ;
555
-
556
- idx = calc_wheel_index (timer -> expires , base -> clk , bucket_expiry );
557
- enqueue_timer (base , timer , idx );
558
- }
559
-
560
536
static void
561
537
trigger_dyntick_cpu (struct timer_base * base , struct timer_list * timer ,
562
538
unsigned long bucket_expiry )
@@ -598,15 +574,31 @@ trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer,
598
574
wake_up_nohz_cpu (base -> cpu );
599
575
}
600
576
601
- static void
602
- internal_add_timer (struct timer_base * base , struct timer_list * timer )
577
+ /*
578
+ * Enqueue the timer into the hash bucket, mark it pending in
579
+ * the bitmap, store the index in the timer flags then wake up
580
+ * the target CPU if needed.
581
+ */
582
+ static void enqueue_timer (struct timer_base * base , struct timer_list * timer ,
583
+ unsigned int idx , unsigned long bucket_expiry )
603
584
{
604
- unsigned long bucket_expiry ;
585
+ hlist_add_head (& timer -> entry , base -> vectors + idx );
586
+ __set_bit (idx , base -> pending_map );
587
+ timer_set_idx (timer , idx );
605
588
606
- __internal_add_timer ( base , timer , & bucket_expiry );
589
+ trace_timer_start ( timer , timer -> expires , timer -> flags );
607
590
trigger_dyntick_cpu (base , timer , bucket_expiry );
608
591
}
609
592
593
+ static void internal_add_timer (struct timer_base * base , struct timer_list * timer )
594
+ {
595
+ unsigned long bucket_expiry ;
596
+ unsigned int idx ;
597
+
598
+ idx = calc_wheel_index (timer -> expires , base -> clk , & bucket_expiry );
599
+ enqueue_timer (base , timer , idx , bucket_expiry );
600
+ }
601
+
610
602
#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
611
603
612
604
static struct debug_obj_descr timer_debug_descr ;
@@ -1057,16 +1049,13 @@ __mod_timer(struct timer_list *timer, unsigned long expires, unsigned int option
1057
1049
/*
1058
1050
* If 'idx' was calculated above and the base time did not advance
1059
1051
* between calculating 'idx' and possibly switching the base, only
1060
- * enqueue_timer() and trigger_dyntick_cpu() is required. Otherwise
1061
- * we need to (re)calculate the wheel index via
1062
- * internal_add_timer().
1052
+ * enqueue_timer() is required. Otherwise we need to (re)calculate
1053
+ * the wheel index via internal_add_timer().
1063
1054
*/
1064
- if (idx != UINT_MAX && clk == base -> clk ) {
1065
- enqueue_timer (base , timer , idx );
1066
- trigger_dyntick_cpu (base , timer , bucket_expiry );
1067
- } else {
1055
+ if (idx != UINT_MAX && clk == base -> clk )
1056
+ enqueue_timer (base , timer , idx , bucket_expiry );
1057
+ else
1068
1058
internal_add_timer (base , timer );
1069
- }
1070
1059
1071
1060
out_unlock :
1072
1061
raw_spin_unlock_irqrestore (& base -> lock , flags );
0 commit comments