From b9837b4aca7b8520b7a53435257198e5a9425458 Mon Sep 17 00:00:00 2001 From: johnnyaiai Date: Thu, 22 Dec 2022 19:26:44 +0800 Subject: [PATCH] Revert 'sched: adaptive default skew_tick value' Signed-off-by: johnnyaiai Reviewed-by: Alex Shi --- kernel/time/tick-sched.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index cd1aa98b33aa..4419486d7413 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1306,12 +1306,7 @@ static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer) return HRTIMER_RESTART; } -#ifdef CONFIG_ARM64 static int sched_skew_tick; -#else -/* value -1 means not set via cmdline */ -static int sched_skew_tick = -1; -#endif static int __init skew_tick(char *str) { @@ -1328,7 +1323,6 @@ void tick_setup_sched_timer(void) { struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); ktime_t now = ktime_get(); - int cpus = num_possible_cpus(); /* * Emulate tick processing via per-CPU hrtimers: @@ -1340,9 +1334,9 @@ void tick_setup_sched_timer(void) hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update()); /* Offset the tick to avert jiffies_lock contention. */ - if (sched_skew_tick > 0 || (sched_skew_tick < 0 && cpus > 16)) { + if (sched_skew_tick) { u64 offset = ktime_to_ns(tick_period) >> 1; - do_div(offset, cpus); + do_div(offset, num_possible_cpus()); offset *= smp_processor_id(); hrtimer_add_expires_ns(&ts->sched_timer, offset); }