public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>,
	ck list <ck@vds.kolivas.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Dmitry Adamushko <dmitry.adamushko@gmail.com>
Subject: [PATCH] sched: implement staircase deadline cpu scheduler improvements fix
Date: Wed, 4 Apr 2007 23:22:05 +1000	[thread overview]
Message-ID: <200704042322.06085.kernel@kolivas.org> (raw)
In-Reply-To: <4612E3C3.6020806@googlemail.com>

On Wednesday 04 April 2007 09:31, Michal Piotrowski wrote:
> Con Kolivas napisał(a):
> > On Wednesday 04 April 2007 08:20, Michal Piotrowski wrote:
> >> Michal Piotrowski napisał(a):
> >>> http://www.stardust.webpages.pl/files/tbf/bitis-gabonica/2.6.21-rc5-mm4
> >>>/m m-oops
> >>> http://www.stardust.webpages.pl/files/tbf/bitis-gabonica/2.6.21-rc5-mm4
> >>>/m m-config

> >> Con, I think that your
> >> sched-implement-staircase-deadline-cpu-scheduler-staircase-improvements.
> >>pat ch is causing this oops.
> >
> > Thanks for heads up!

Confirmed offline with Michal that the following patch fixes it. Thanks!

This should also make nice work better in the way the previous patch intended
it to.

---
Use of memset was bogus. Fix it.

Fix exiting recalc_task_prio without p->array being updated.

Microoptimisation courtesy of Dmitry Adamushko <dmitry.adamushko@gmail.com>

Signed-off-by: Con Kolivas <kernel@kolivas.org>

---
 kernel/sched.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Index: linux-2.6.21-rc5-mm4/kernel/sched.c
===================================================================
--- linux-2.6.21-rc5-mm4.orig/kernel/sched.c	2007-04-04 12:14:29.000000000 +1000
+++ linux-2.6.21-rc5-mm4/kernel/sched.c	2007-04-04 12:49:39.000000000 +1000
@@ -683,11 +683,13 @@ static void dequeue_task(struct task_str
  * The task is being queued on a fresh array so it has its entitlement
  * bitmap cleared.
  */
-static inline void task_new_array(struct task_struct *p, struct rq *rq)
+static void task_new_array(struct task_struct *p, struct rq *rq,
+			   struct prio_array *array)
 {
 	bitmap_zero(p->bitmap, PRIO_RANGE);
 	p->rotation = rq->prio_rotation;
 	p->time_slice = p->quota;
+	p->array = array;
 }
 
 /* Find the first slot from the relevant prio_matrix entry */
@@ -709,6 +711,8 @@ static inline int next_entitled_slot(str
 	DECLARE_BITMAP(tmp, PRIO_RANGE);
 	int search_prio, uprio = USER_PRIO(p->static_prio);
 
+	if (!rq->prio_level[uprio])
+		rq->prio_level[uprio] = MAX_RT_PRIO;
 	/*
 	 * Only priorities equal to the prio_level and above for their
 	 * static_prio are acceptable, and only if it's not better than
@@ -736,11 +740,8 @@ static inline int next_entitled_slot(str
 
 static void queue_expired(struct task_struct *p, struct rq *rq)
 {
-	p->array = rq->expired;
-	task_new_array(p, rq);
+	task_new_array(p, rq, rq->expired);
 	p->prio = p->normal_prio = first_prio_slot(p);
-	p->time_slice = p->quota;
-	p->rotation = rq->prio_rotation;
 }
 
 #ifdef CONFIG_SMP
@@ -800,9 +801,9 @@ static void recalc_task_prio(struct task
 			queue_expired(p, rq);
 			return;
 		} else
-			task_new_array(p, rq);
+			task_new_array(p, rq, array);
 	} else
-		task_new_array(p, rq);
+		task_new_array(p, rq, array);
 
 	queue_prio = next_entitled_slot(p, rq);
 	if (queue_prio >= MAX_PRIO) {
@@ -3445,7 +3446,7 @@ EXPORT_SYMBOL(sub_preempt_count);
 
 static inline void reset_prio_levels(struct rq *rq)
 {
-	memset(rq->prio_level, MAX_RT_PRIO, ARRAY_SIZE(rq->prio_level));
+	memset(rq->prio_level, 0, sizeof(int) * PRIO_RANGE);
 }
 
 /*

-- 
-ck

  reply	other threads:[~2007-04-04 13:25 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-03  5:47 2.6.21-rc5-mm4 Andrew Morton
2007-04-03 12:57 ` 2.6.21-rc5-mm4 Jiri Kosina
2007-04-03 15:11   ` 2.6.21-rc5-mm4 Kok, Auke
2007-04-03 16:30     ` 2.6.21-rc5-mm4 Jiri Kosina
2007-04-03 17:19       ` 2.6.21-rc5-mm4 Kok, Auke
2007-04-03 17:42         ` 2.6.21-rc5-mm4 Jiri Kosina
2007-04-04 16:10           ` 2.6.21-rc5-mm4 Jiri Kosina
2007-04-04 17:22             ` 2.6.21-rc5-mm4 Eric W. Biederman
2007-04-06 13:23               ` 2.6.21-rc5-mm4 Jiri Kosina
2007-04-06 14:32                 ` 2.6.21-rc5-mm4 Eric W. Biederman
2007-04-03 16:11 ` 2.6.21-rc5-mm4 Michal Piotrowski
2007-04-03 22:20   ` 2.6.21-rc5-mm4 Michal Piotrowski
2007-04-03 22:31     ` 2.6.21-rc5-mm4 Con Kolivas
2007-04-03 23:31       ` 2.6.21-rc5-mm4 Michal Piotrowski
2007-04-04 13:22         ` Con Kolivas [this message]
2007-04-03 19:48 ` 2.6.21-rc5-mm4 Randy Dunlap
2007-04-03 19:51   ` 2.6.21-rc5-mm4 Davide Libenzi
2007-04-03 20:31 ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-03 20:40   ` 2.6.21-rc5-mm4 Christoph Lameter
2007-04-03 22:53     ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-03 22:59       ` 2.6.21-rc5-mm4 Christoph Lameter
2007-04-03 23:40         ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-03 23:41           ` 2.6.21-rc5-mm4 Christoph Lameter
2007-04-04  1:16       ` 2.6.21-rc5-mm4 Christoph Lameter
2007-04-04 15:12         ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-04 15:27           ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-04 17:13           ` 2.6.21-rc5-mm4 (SLUB powerpc) Christoph Lameter
2007-04-04 17:33             ` Badari Pulavarty
2007-04-04 17:35               ` Christoph Lameter
2007-04-04 20:53                 ` Badari Pulavarty
2007-04-03 21:55 ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-03 23:19   ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-03 23:27     ` 2.6.21-rc5-mm4 Christoph Lameter
2007-04-03 23:38       ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-03 23:40         ` 2.6.21-rc5-mm4 Christoph Lameter
2007-04-03 23:51           ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-03 23:55             ` 2.6.21-rc5-mm4 Christoph Lameter
2007-04-04 14:53               ` 2.6.21-rc5-mm4 Badari Pulavarty
2007-04-04 17:03                 ` 2.6.21-rc5-mm4 (SLUB) Christoph Lameter
2007-04-04 18:02                   ` Badari Pulavarty
2007-04-04 18:04                     ` Christoph Lameter
2007-04-04 18:22                       ` Christoph Lameter
2007-04-04 22:53                         ` Badari Pulavarty
2007-04-04 22:59                           ` Christoph Lameter
2007-04-04 23:42                             ` Badari Pulavarty
2007-04-05  0:31                               ` Christoph Lameter
2007-04-05  2:44                                 ` Badari Pulavarty
2007-04-05  3:15                                   ` Christoph Lameter
2007-04-05  4:29                                   ` Christoph Lameter
2007-04-05 15:16                                     ` Badari Pulavarty
2007-04-05 18:19                                       ` Christoph Lameter
2007-04-13 15:13                       ` [PATCH] cache_k8_northbridges() overflows beyond allocation (Was: 2.6.21-rc5-mm4 (SLUB)) Badari Pulavarty
2007-04-13 15:45                         ` Andi Kleen
2007-04-13 16:42                           ` Chuck Ebbert
2007-04-13 16:52                             ` Andi Kleen
2007-04-13 16:57                           ` Andrew Morton
2007-04-13 18:07                         ` Christoph Lameter
2007-04-04 18:09                     ` 2.6.21-rc5-mm4 (SLUB) Christoph Lameter
2007-04-03 22:40 ` 2.6.21-rc5-mm4 J.A. Magallón
2007-04-03 22:51   ` 2.6.21-rc5-mm4 Andrew Morton
2007-04-03 22:58     ` 2.6.21-rc5-mm4 J.A. Magallón
2007-04-03 23:22       ` 2.6.21-rc5-mm4 Valdis.Kletnieks
2007-04-03 23:43         ` 2.6.21-rc5-mm4 J.A. Magallón
2007-04-04  1:35 ` 2.6.21-rc5-mm4 Valdis.Kletnieks
2007-04-04  2:20   ` 2.6.21-rc5-mm4 Randy Dunlap
2007-04-04  2:46     ` 2.6.21-rc5-mm4 Valdis.Kletnieks
2007-04-04  3:37       ` 2.6.21-rc5-mm4 Randy Dunlap
2007-04-04 17:55         ` 2.6.21-rc5-mm4 Valdis.Kletnieks
2007-04-05 11:14           ` 2.6.21-rc5-mm4 Sam Ravnborg
2007-04-04 15:25 ` [-mm patch] net/: possible cleanups Adrian Bunk
2007-04-04 15:25 ` [-mm patch] unexport pci_proc_attach_device Adrian Bunk
2007-04-04 21:56 ` 2.6.21-rc5-mm4 Antonino A. Daplas
2007-04-04 22:10   ` 2.6.21-rc5-mm4 Andrew Morton
2007-04-04 22:38     ` 2.6.21-rc5-mm4 Con Kolivas
2007-04-04 23:55       ` 2.6.21-rc5-mm4 Antonino A. Daplas
2007-04-05  0:56 ` 2.6.21-rc5-mm4 Antonino A. Daplas
2007-04-05 13:53 ` [-mm patch] pcm_native: lockdep warning when launching jack Frederik Deweerdt
2007-04-05 15:00   ` Takashi Iwai
2007-04-05 16:33 ` RAID1 "out of memory" error, was Re: 2.6.21-rc5-mm4 Reuben Farrelly
2007-04-05 20:21   ` Andrew Morton
2007-04-06  5:34     ` Dan Williams
2007-04-11  3:31   ` Neil Brown
2007-04-05 17:02 ` 2.6.21-rc5-mm4 Valdis.Kletnieks
2007-04-05 20:31   ` 2.6.21-rc5-mm4 Andrew Morton
2007-04-06 15:26     ` 2.6.21-rc5-mm4 Valdis.Kletnieks
2007-04-06 19:33       ` 2.6.21-rc5-mm4 Andrew Morton

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=200704042322.06085.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=akpm@linux-foundation.org \
    --cc=ck@vds.kolivas.org \
    --cc=dmitry.adamushko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --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