mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Adamushko <dmitry.adamushko@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: fix to use invalid sched_class
Date: Thu, 20 Sep 2007 00:05:39 +0200	[thread overview]
Message-ID: <1190239539.19576.5.camel@earth> (raw)

> > 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()))

---




             reply	other threads:[~2007-09-19 22:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 22:05 Dmitry Adamushko [this message]
2007-09-20  0:01 ` Hiroshi Shimamoto
2007-09-20  7:17   ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2007-09-19 21:14 Hiroshi Shimamoto
2007-09-19 21:37 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1190239539.19576.5.camel@earth \
    --to=dmitry.adamushko@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=h-shimamoto@ct.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®