diff options
author | Richard Braun <rbraun@sceen.net> | 2013-02-28 22:35:59 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2013-02-28 22:35:59 +0100 |
commit | 3dd8caff1ed519b51195c714f0ca412c289f9d75 (patch) | |
tree | 4198b46405ba88dd91f0fce6fe1f0cf1da62bb97 /kern/thread.c | |
parent | d724d6a6170ec225317b53c7ba5b86fc03cef67c (diff) |
kern/thread: detect scheduling unfairness
Diffstat (limited to 'kern/thread.c')
-rw-r--r-- | kern/thread.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kern/thread.c b/kern/thread.c index d992de64..888a411b 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -537,12 +537,19 @@ thread_sched_ts_get_next(struct thread_runq *runq) static void thread_sched_ts_reset(struct thread_ts_runq *ts_runq) { + static int unfair; struct thread_ts_group *group; ts_runq->work = 0; list_for_each_entry(&ts_runq->groups, group, node) { - assert(group->work == group->weight); + if (likely(!unfair)) + if (unlikely(group->work != group->weight)) { + unfair = 1; + printk("thread: warning: preemption disabled too long is " + "causing scheduling unfairness\n"); + } + group->work = 0; } } |