Revert "sched: adaptive default skew_tick value"

This reverts commit ca7d96bf43.

Maintain consistency and alignment with upstream, and this patch
is not very friendly to virtualization.

Signed-off-by: Yongliang Gao <leonylgao@tencent.com>
Reviewed-by: Jianping Liu <frankjpliu@tencent.com>
This commit is contained in:
Yongliang Gao 2024-08-23 19:30:22 +08:00 committed by frankjpliu
parent a1aa259039
commit 44f5072e76
1 changed files with 3 additions and 5 deletions

View File

@ -1502,8 +1502,7 @@ static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer)
return HRTIMER_RESTART;
}
/* -1 for adaptive setting (enable skew tick for machines with >16 CPUs) */
static int sched_skew_tick = IS_ENABLED(CONFIG_X86) ? -1 : 0;
static int sched_skew_tick;
static int __init skew_tick(char *str)
{
@ -1520,7 +1519,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:
@ -1532,9 +1530,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 = TICK_NSEC >> 1;
do_div(offset, cpus);
do_div(offset, num_possible_cpus());
offset *= smp_processor_id();
hrtimer_add_expires_ns(&ts->sched_timer, offset);
}