diff options
author | jeff <jeff@FreeBSD.org> | 2008-07-19 05:13:47 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2008-07-19 05:13:47 +0000 |
commit | b2f69d1b1e36e6bc223909dcc50635e58a5b2389 (patch) | |
tree | e791dab04d1df85eee7438cc11cbe584906ada77 /sys/kern/sched_ule.c | |
parent | 76a236f319bb3635218cb2c20322788d437ce2ad (diff) | |
download | FreeBSD-src-b2f69d1b1e36e6bc223909dcc50635e58a5b2389.zip FreeBSD-src-b2f69d1b1e36e6bc223909dcc50635e58a5b2389.tar.gz |
- Check whether we've recorded this tick in ts_ticks on another cpu in
sched_tick() to prevent multiple increments for one tick. This pushes
the value out of range and breaks priority calculation.
Reviewed by: kib
Found by: pho/nokia
Sponsored by: Nokia
MFC after: 3 days
Diffstat (limited to 'sys/kern/sched_ule.c')
-rw-r--r-- | sys/kern/sched_ule.c | 6 |
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; |