@@ -186,7 +186,6 @@ static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now)
186186{
187187 int cpu = smp_processor_id ();
188188
189- #ifdef CONFIG_NO_HZ_COMMON
190189 /*
191190 * Check if the do_timer duty was dropped. We don't care about
192191 * concurrency: This happens only when the CPU in charge went
@@ -197,13 +196,13 @@ static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now)
197196 * If nohz_full is enabled, this should not happen because the
198197 * 'tick_do_timer_cpu' CPU never relinquishes.
199198 */
200- if (unlikely (tick_do_timer_cpu == TICK_DO_TIMER_NONE )) {
199+ if (IS_ENABLED (CONFIG_NO_HZ_COMMON ) &&
200+ unlikely (tick_do_timer_cpu == TICK_DO_TIMER_NONE )) {
201201#ifdef CONFIG_NO_HZ_FULL
202202 WARN_ON_ONCE (tick_nohz_full_running );
203203#endif
204204 tick_do_timer_cpu = cpu ;
205205 }
206- #endif
207206
208207 /* Check if jiffies need an update */
209208 if (tick_do_timer_cpu == cpu )
@@ -230,7 +229,6 @@ static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now)
230229
231230static void tick_sched_handle (struct tick_sched * ts , struct pt_regs * regs )
232231{
233- #ifdef CONFIG_NO_HZ_COMMON
234232 /*
235233 * When we are idle and the tick is stopped, we have to touch
236234 * the watchdog as we might not schedule for a really long
@@ -239,7 +237,7 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
239237 * idle" jiffy stamp so the idle accounting adjustment we do
240238 * when we go busy again does not account too many ticks.
241239 */
242- if (ts -> tick_stopped ) {
240+ if (IS_ENABLED ( CONFIG_NO_HZ_COMMON ) && ts -> tick_stopped ) {
243241 touch_softlockup_watchdog_sched ();
244242 if (is_idle_task (current ))
245243 ts -> idle_jiffies ++ ;
@@ -250,7 +248,7 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
250248 */
251249 ts -> next_tick = 0 ;
252250 }
253- #endif
251+
254252 update_process_times (user_mode (regs ));
255253 profile_tick (CPU_PROFILING );
256254}
@@ -1587,10 +1585,8 @@ void tick_cancel_sched_timer(int cpu)
15871585 ktime_t idle_sleeptime , iowait_sleeptime ;
15881586 unsigned long idle_calls , idle_sleeps ;
15891587
1590- # ifdef CONFIG_HIGH_RES_TIMERS
1591- if (ts -> sched_timer .base )
1588+ if (IS_ENABLED (CONFIG_HIGH_RES_TIMERS ) && ts -> sched_timer .base )
15921589 hrtimer_cancel (& ts -> sched_timer );
1593- # endif
15941590
15951591 idle_sleeptime = ts -> idle_sleeptime ;
15961592 iowait_sleeptime = ts -> iowait_sleeptime ;
0 commit comments