@@ -186,7 +186,6 @@ static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now)
186
186
{
187
187
int cpu = smp_processor_id ();
188
188
189
- #ifdef CONFIG_NO_HZ_COMMON
190
189
/*
191
190
* Check if the do_timer duty was dropped. We don't care about
192
191
* 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)
197
196
* If nohz_full is enabled, this should not happen because the
198
197
* 'tick_do_timer_cpu' CPU never relinquishes.
199
198
*/
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 )) {
201
201
#ifdef CONFIG_NO_HZ_FULL
202
202
WARN_ON_ONCE (tick_nohz_full_running );
203
203
#endif
204
204
tick_do_timer_cpu = cpu ;
205
205
}
206
- #endif
207
206
208
207
/* Check if jiffies need an update */
209
208
if (tick_do_timer_cpu == cpu )
@@ -230,7 +229,6 @@ static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now)
230
229
231
230
static void tick_sched_handle (struct tick_sched * ts , struct pt_regs * regs )
232
231
{
233
- #ifdef CONFIG_NO_HZ_COMMON
234
232
/*
235
233
* When we are idle and the tick is stopped, we have to touch
236
234
* 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)
239
237
* idle" jiffy stamp so the idle accounting adjustment we do
240
238
* when we go busy again does not account too many ticks.
241
239
*/
242
- if (ts -> tick_stopped ) {
240
+ if (IS_ENABLED ( CONFIG_NO_HZ_COMMON ) && ts -> tick_stopped ) {
243
241
touch_softlockup_watchdog_sched ();
244
242
if (is_idle_task (current ))
245
243
ts -> idle_jiffies ++ ;
@@ -250,7 +248,7 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
250
248
*/
251
249
ts -> next_tick = 0 ;
252
250
}
253
- #endif
251
+
254
252
update_process_times (user_mode (regs ));
255
253
profile_tick (CPU_PROFILING );
256
254
}
@@ -1587,10 +1585,8 @@ void tick_cancel_sched_timer(int cpu)
1587
1585
ktime_t idle_sleeptime , iowait_sleeptime ;
1588
1586
unsigned long idle_calls , idle_sleeps ;
1589
1587
1590
- # ifdef CONFIG_HIGH_RES_TIMERS
1591
- if (ts -> sched_timer .base )
1588
+ if (IS_ENABLED (CONFIG_HIGH_RES_TIMERS ) && ts -> sched_timer .base )
1592
1589
hrtimer_cancel (& ts -> sched_timer );
1593
- # endif
1594
1590
1595
1591
idle_sleeptime = ts -> idle_sleeptime ;
1596
1592
iowait_sleeptime = ts -> iowait_sleeptime ;
0 commit comments