public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Cc: linux-kernel@vger.kernel.org,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] sched: fix to use invalid sched_class
Date: Wed, 19 Sep 2007 23:37:15 +0200	[thread overview]
Message-ID: <20070919213715.GA14086@elte.hu> (raw)
In-Reply-To: <46F19148.4090404@ct.jp.nec.com>


* Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> wrote:

> Hi Ingo,
> 
> I found an issue about the scheduler.
> If you need a test case, please let me know.
> Here is a patch.
> 
> When using rt_mutex, a NULL pointer dereference is occurred at
> enqueue_task_rt. Here is a scenario;
> 1) there are two threads, the thread A is fair_sched_class and
>    thread B is rt_sched_class.
> 2) Thread A is boosted up to rt_sched_class, because the thread A
>    has a rt_mutex lock and the thread B is waiting the lock.
> 3) At this time, when thread A create a new thread C, the thread
>    C has a rt_sched_class.
> 4) When doing wake_up_new_task() for the thread C, the priority
>    of the thread C is out of the RT priority range, because the
>    normal priority of thread A is not the RT priority. It makes
>    data corruption by overflowing the rt_prio_array.
> The new thread C should be fair_sched_class.
> 
> 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!

	Ingo

  reply	other threads:[~2007-09-19 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 21:14 [PATCH] sched: fix to use invalid sched_class Hiroshi Shimamoto
2007-09-19 21:37 ` Ingo Molnar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-09-19 22:05 Dmitry Adamushko
2007-09-20  0:01 ` Hiroshi Shimamoto
2007-09-20  7:17   ` 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=20070919213715.GA14086@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=h-shimamoto@ct.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    /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