mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: Andrew Morton <akpm@digeo.com>
Cc: Maciej Soltysiak <solt@dns.toxicfilms.tv>, linux-kernel@vger.kernel.org
Subject: Re: must-fix list for 2.6.0
Date: Thu, 01 May 2003 08:26:15 +0200	[thread overview]
Message-ID: <5.2.0.9.2.20030501081758.00cd5d38@pop.gmx.net> (raw)
In-Reply-To: <5.2.0.9.2.20030501035717.00ca26c8@pop.gmx.net>

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

At 05:21 AM 5/1/2003 +0200, Mike Galbraith wrote:
>At 12:11 PM 4/30/2003 -0700, Andrew Morton wrote:
>>Maciej Soltysiak <solt@dns.toxicfilms.tv> wrote:
>> >
>> >
>> > Also there is one issue, i am not sure if this may be a kernel issue,
>> > but with setiathome running in a X desktop environment all apps work fine,
>> > but when i run openoffice, openoffice responds with 5 second delay.
>>
>>That'll be the changed sched_yield() semantics.
>>
>>The below patch should fix that up, but we need to decide whether the (rather
>>unclear) advantages of the sched_yield() change outweigh the breakage which
>>it caused linuxthreads applications.

<snip>

Anyway, attached is a patchlet that works for me if anyone wants to try 
it.  I removed printk's, and whatnot but it'll have some offsets because of 
other butchery in my X-para-mental tree ;-)

         -Mike   

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

--- kernel/sched.c.org	Fri Apr 25 06:24:34 2003
+++ kernel/sched.c	Thu May  1 07:38:00 2003
@@ -1265,7 +1323,7 @@
 	runqueue_t *rq;
 	prio_array_t *array;
 	struct list_head *queue;
-	int idx;
+	int idx = 0;
 
 	/*
 	 * Test if we are atomic.  Since do_exit() needs to call into
@@ -1330,7 +1388,19 @@
 		rq->expired_timestamp = 0;
 	}
 
-	idx = sched_find_first_bit(array->bitmap);
+	if (!idx || idx >= MAX_PRIO)
+		idx = sched_find_first_bit(array->bitmap);
+	else {
+		idx = find_next_bit(array->bitmap, MAX_PRIO, idx + 1);
+		if (idx >= MAX_PRIO) {
+			idx = 0;
+			spin_unlock_irq(&rq->lock);
+			reacquire_kernel_lock(current);
+			preempt_enable_no_resched();
+			goto need_resched;
+		}
+	}
+
 	queue = array->queue + idx;
 	next = list_entry(queue->next, task_t, run_list);
 
@@ -1984,19 +2054,12 @@
 	prio_array_t *array = current->array;
 
 	/*
-	 * We implement yielding by moving the task into the expired
-	 * queue.
-	 *
-	 * (special rule: RT tasks will just roundrobin in the active
-	 *  array.)
+	 * We implement yielding by moving the task to the back of
+	 * the queue.
 	 */
-	if (likely(!rt_task(current))) {
-		dequeue_task(current, array);
-		enqueue_task(current, rq->expired);
-	} else {
-		list_del(&current->run_list);
-		list_add_tail(&current->run_list, array->queue + current->prio);
-	}
+	list_del(&current->run_list);
+	list_add_tail(&current->run_list, array->queue + current->prio);
+	set_tsk_need_resched(current);
 	/*
 	 * Since we are going to call schedule() anyway, there's
 	 * no need to preempt:

  reply	other threads:[~2003-05-01  6:09 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-29 22:57 Andrew Morton
2003-04-29 23:22 ` John Bradford
2003-04-29 23:37   ` Andrew Morton
2003-04-30  3:19 ` William Lee Irwin III
2003-04-30  4:45   ` Andrew Morton
2003-04-30  4:52     ` William Lee Irwin III
2003-05-01  4:32     ` William Lee Irwin III
2003-04-30  8:30 ` Benjamin Herrenschmidt
2003-04-30 10:16 ` Maciej Soltysiak
2003-04-30 19:11   ` Andrew Morton
2003-04-30 23:11     ` Rick Lindsley
2003-04-30 23:21       ` Andrew Morton
2003-04-30 23:47         ` viro
2003-04-30 23:59           ` Andrew Morton
2003-05-01  6:27             ` Christoph Hellwig
2003-05-01  5:49               ` Shawn
2003-05-01 10:14                 ` Christoph Hellwig
2003-05-01  9:47                   ` Alan Cox
2003-05-01 15:44               ` Robert Love
2003-05-01  0:09           ` Robert Love
2003-05-01  0:51             ` Gerrit Huizenga
2003-05-01  5:40               ` Dave Hansen
2003-05-01 11:57                 ` Bill Huey
2003-04-30 23:53         ` Robert Love
2003-05-01  8:36         ` Arjan van de Ven
2003-05-01  8:42           ` Andrew Morton
2003-05-01  8:47             ` Arjan van de Ven
2003-04-30 23:41       ` Robert Love
2003-05-01 16:50         ` Hubertus Franke
2003-05-01  3:21     ` Mike Galbraith
2003-05-01  6:26       ` Mike Galbraith [this message]
2003-05-01 14:33 ` Christoph Hellwig
2003-05-01 18:42   ` Andrew Morton
2003-05-01 18:47     ` Christoph Hellwig
2003-05-02  1:57       ` Andreas Boman
     [not found] <20030429155731.07811707.akpm@digeo.com.suse.lists.linux.kernel>
2003-04-30  1:36 ` Andi Kleen
2003-04-30 18:09   ` Pavel Machek
2003-04-30 18:15     ` Andi Kleen
2003-04-30 19:11       ` Pavel Machek
     [not found] <20030429231009$1e6b@gated-at.bofh.it>
2003-04-30  4:55 ` Florian Weimer
2003-04-30 10:18   ` Maciej Soltysiak
2003-05-01 11:24   ` David S. Miller
2003-05-01 11:27     ` Florian Weimer
2003-05-01 12:03       ` David S. Miller
2003-05-01 12:05       ` David S. Miller
2003-05-02 16:28         ` Carl-Daniel Hailfinger
2003-05-02 21:14           ` David S. Miller

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.20030501081758.00cd5d38@pop.gmx.net \
    --to=efault@gmx.de \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=solt@dns.toxicfilms.tv \
    /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®