Messages in this thread Patch in this message |  | | | Date | Mon, 9 Jul 2012 20:23:31 +0800 | | Subject | [patch] BFS 421-1: fix yield_to | | From | Hillf Danton <> |
| |
The time slice of local runqueue is bogus but updated in the main schedule function.
SOB: Hillf Danton <dhillf@gmail.com> --- --- a/kernel/sched/bfs.c Mon Jul 9 20:05:00 2012 +++ b/kernel/sched/bfs.c Mon Jul 9 20:06:00 2012 @@ -4634,21 +4634,16 @@ EXPORT_SYMBOL(yield); bool __sched yield_to(struct task_struct *p, bool preempt) { unsigned long flags; - bool yielded = 0; + bool yielded = false; struct rq *rq;
rq = this_rq(); grq_lock_irqsave(&flags); if (task_running(p) || p->state) goto out_unlock; - yielded = 1; + yielded = true; if (p->deadline > rq->rq_deadline) p->deadline = rq->rq_deadline; - p->time_slice += rq->rq_time_slice; - rq->rq_time_slice = 0; - if (p->time_slice > timeslice()) - p->time_slice = timeslice(); - set_tsk_need_resched(rq->curr); out_unlock: grq_unlock_irqrestore(&flags);
--
|  |