mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: davidm@hpl.hp.com
Cc: linux-kernel@vger.kernel.org, linux-ia64@linuxia64.org
Subject: Re: web page on O(1) scheduler
Date: Wed, 21 May 2003 11:30:39 +0200	[thread overview]
Message-ID: <5.2.0.9.2.20030521112745.01eb9c80@pop.gmx.net> (raw)
In-Reply-To: <5.2.0.9.2.20030521111037.01ed0d58@pop.gmx.net>

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

At 11:26 AM 5/21/2003 +0200, Mike Galbraith wrote:

>Try the attached overly simplistic (KISS:) diff, and watch your starvation 
>issues be very noticably reduced.

Ahem ;-)

Now even attached.

         -Mike 

[-- Attachment #2: xx.diff --]
[-- Type: application/octet-stream, Size: 929 bytes --]

--- linux-2.5.69/kernel/sched.c.org	Wed May 21 07:45:00 2003
+++ linux-2.5.69/kernel/sched.c	Wed May 21 08:27:09 2003
@@ -1264,7 +1264,7 @@
 	task_t *prev, *next;
 	runqueue_t *rq;
 	prio_array_t *array;
-	struct list_head *queue;
+	struct list_head *head, *curr;
 	int idx;
 
 	/*
@@ -1331,8 +1331,22 @@
 	}
 
 	idx = sched_find_first_bit(array->bitmap);
-	queue = array->queue + idx;
-	next = list_entry(queue->next, task_t, run_list);
+next_queue:
+	head = array->queue + idx;
+	curr = head->next;
+	next = list_entry(curr, task_t, run_list);
+	curr = curr->next;
+	/*
+	 * If we are about to wrap back to the head of the queue,
+	 * give a lower priority queue a chance to sneak one in.
+	 */
+	if (idx == prev->prio && curr == head && array->nr_active > 1) {
+		int tmp = find_next_bit(array->bitmap, MAX_PRIO, ++idx);
+		if (tmp < MAX_PRIO) {
+			idx = tmp;
+			goto next_queue;
+		}
+	}
 
 switch_tasks:
 	prefetch(next);

  reply	other threads:[~2003-05-21  9:13 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21  6:49 David Mosberger
2003-05-21  9:01 ` Arjan van de Ven
2003-05-21 10:40   ` [Linux-ia64] " Duraid Madina
2003-05-21 10:43     ` Christoph Hellwig
2003-05-21 13:12     ` Arjan van de Ven
2003-05-21 13:51       ` Olivier Galibert
2003-05-28 22:12         ` Bill Davidsen
     [not found]         ` <Pine.LNX.3.96.1030528180909.21414B-100000@gatekeeper.tmr.c om>
2003-05-29  5:59           ` Mike Galbraith
2003-06-02  8:05             ` Ingo Molnar
2003-06-04  4:07               ` Bill Davidsen
     [not found]             ` <Pine.LNX.4.44.0306020949520.3375-100000@localhost.localdom ain>
2003-06-02 13:51               ` Mike Galbraith
2003-06-04  3:52             ` Bill Davidsen
2003-06-04  4:55               ` David Schwartz
     [not found]             ` <Pine.LNX.3.96.1030603234616.16495B-100000@gatekeeper.tmr.c om>
2003-06-04  7:13               ` Mike Galbraith
2003-06-04 15:30                 ` Jan Harkes
2003-05-21 19:18       ` Duraid Madina
2003-05-21 20:03         ` Helge Hafting
2003-05-21 22:59         ` Alan Cox
2003-05-21 15:18   ` David Mosberger
2003-05-23  1:07   ` [Linux-ia64] " Hans Boehm
2003-05-23  8:30     ` Arjan van de Ven
2003-05-21  9:26 ` Mike Galbraith
2003-05-21  9:30   ` Mike Galbraith [this message]
2003-05-21 17:56   ` David Mosberger
2003-05-21 20:46     ` Mike Galbraith
2003-05-22  9:52     ` Mike Galbraith
2003-05-22 16:25       ` Mike Galbraith
2003-05-22 17:58         ` David Mosberger
2003-05-27 15:16         ` [case closed] " Mike Galbraith
2003-06-03 20:59       ` sched.c gives ICE [Was: Re: web page on O(1) scheduler] J.A. Magallon
2003-06-03 22:29         ` Mike Galbraith
2003-06-22 22:03         ` J.A. Magallon
2003-06-22 22:10           ` J.A. Magallon
2003-05-22  0:38   ` web page on O(1) scheduler Rik van Riel
     [not found]   ` <Pine.LNX.4.50L.0305212038120.5425-100000@imladris.surriel. com>
2003-05-22  5:52     ` Mike Galbraith
2003-05-22 14:47       ` Valdis.Kletnieks
2003-05-22 16:12         ` Mike Galbraith
2003-05-25  9:17       ` Mike Galbraith
2003-05-21 18:31 ` [Linux-ia64] " David Mosberger
2003-05-21 20:00   ` Cyclades Cyclom-Y ISA on 2.5.69 John Stoffel

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=5.2.0.9.2.20030521112745.01eb9c80@pop.gmx.net \
    --to=efault@gmx.de \
    --cc=davidm@hpl.hp.com \
    --cc=linux-ia64@linuxia64.org \
    --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

all inboxes | Powered by JetHome®