lkml.org 
[lkml]   [2012]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subject[Query]: sched/fair: prio_changed_fair()
From
Hi Ingo/Peter,

I am trying to understand the complex scheduler code and just found
something incorrect (maybe i am not reading it well):

File: kernel/sched/fair.c

static void
prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio)
{
if (!p->se.on_rq)
return;

/*
* Reschedule if we are currently running on this runqueue and
* our priority decreased, or if we are not currently running on
* this runqueue and our priority is higher than the current's
*/
if (rq->curr == p) {
if (p->prio > oldprio)
resched_task(rq->curr);
} else
check_preempt_curr(rq, p, 0);
}


Comment says that we must mark the task to be rescheduled, if we
are currently running and our priority has decreased. But in code we
are checking (p->prio > oldprio). i.e. reschedule if we were currently
running and our priority increased.

Sorry if i am wrong :(

--
viresh


\
 
 \ /
  Last update: 2012-11-07 09:21    [W:0.057 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site