summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sched_ule.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 172f41a..c3916c9 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -2163,6 +2163,12 @@ sched_tick(void)
struct td_sched *ts;
ts = curthread->td_sched;
+ /*
+ * Ticks is updated asynchronously on a single cpu. Check here to
+ * avoid incrementing ts_ticks multiple times in a single tick.
+ */
+ if (ts->ts_ltick == ticks)
+ return;
/* Adjust ticks for pctcpu */
ts->ts_ticks += 1 << SCHED_TICK_SHIFT;
ts->ts_ltick = ticks;
OpenPOWER on IntegriCloud