lkml.org 
[lkml]   [2007]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] sched: fix to use invalid sched_class
From
Date
> > Hi Ingo,
> >
> > I found an issue about the scheduler.
> > If you need a test case, please let me know.
> > Here is a patch.
> > [ ... ]
> > The new thread should be valid scheduler class before queuing.
> > This patch fixes to set the suitable scheduler class.
>
> Nice fix! It's a 2.6.23 must-have fix - i'll push it out into the
> scheduler tree. Thanks!

I think, the following approach would be a bit more appropriate
(the missing addition to the already existing "don't leak PI boosting prio"):

(not tested)

---
diff --git a/kernel/sched.c b/kernel/sched.c
index bc1a625..da2139e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1646,6 +1646,8 @@ void sched_fork(struct task_struct *p, int clone_flags)
* Make sure we do not leak PI boosting priority to the child:
*/
p->prio = current->normal_prio;
+ if (!rt_prio(p->prio))
+ p->sched_class = &fair_sched_class;

#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
if (likely(sched_info_on()))
---


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-09-20 00:09    [W:0.043 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site