Skip to contentSkip to conversation

sched: fix to use invalid sched_class

PATCH Dmitry Adamushko 3 participants 3 messages Sep 19, 2007 – Sep 20, 2007

lore
Share & tools
lore
#0 lore raw
Quoted 11 lines
Quoted 8 lines

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)

---

kernel/sched.c +2 -0
index bc1a625..da2139e 100644
@@ -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()))

---

#1 lore raw
Quoted 8 lines · Dmitry Adamushko
Quoted 8 lines
Quoted 8 lines

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.

Quoted 8 lines
Quoted 2 lines

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)

Thank you for reviewing my patch.
Yes, your approach looks better than mine.
I've tested it and it looks working fine in my test case. I attached the test case.

Will you write a patch to replace mine?

Thanks,
Hiroshi Shimamoto

#2 lore raw
Quoted 15 lines · Hiroshi Shimamoto
Quoted 14 lines · Dmitry Adamushko
Quoted 10 lines
Quoted 8 lines

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"):

Quoted 8 lines
Quoted 2 lines

(not tested)

Thank you for reviewing my patch.
Yes, your approach looks better than mine.
I've tested it and it looks working fine in my test case. I attached the test case.

Will you write a patch to replace mine?

thanks for testing it - we can queue Dmitry's clean-up for v2.6.24 (please send me a patch for v2.6.23-rc7). The most important step was to get your fix into v2.6.23.

Ingo