lkml.org 
[lkml]   [2012]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[patch] BFS 421-1: fix yield_to
From
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);

--

\
 
 \ /
  Last update: 2012-07-09 15:41    [from the cache]
©2003-2011 Jasper Spaans