linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: linux kernel mailing list <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Wade <neroz@ii.net>,
	Eugene Teo <eugene.teo@eugeneteo.net>,
	Wiktor Wodecki <wodecki@gmx.de>
Subject: [PATCH] O6.1int
Date: Thu, 17 Jul 2003 12:13:02 +1000	[thread overview]
Message-ID: <200307171213.02643.kernel@kolivas.org> (raw)

The bug in the O6int patch probably wasn't responsible for WIktor's problem 
actually. It shouldn't manifest for a very long time. Anyway here is the fix 
and a couple of minor cleanups.

--- linux-2.6.0-test1-mm1/kernel/sched.c	2003-07-17 11:24:54.000000000 +1000
+++ linux-2.6.0-testck1/kernel/sched.c	2003-07-17 11:59:01.000000000 +1000
@@ -78,7 +78,7 @@
 #define STARVATION_LIMIT	(10*HZ)
 #define SLEEP_BUFFER		(HZ/100)
 #define NODE_THRESHOLD		125
-#define MAX_BONUS		(40 * PRIO_BONUS_RATIO / 100)
+#define MAX_BONUS		(MAX_USER_PRIO * PRIO_BONUS_RATIO / 100)
 
 /*
  * If a task is 'interactive' then we reinsert it in the active
@@ -390,8 +390,6 @@ static inline void activate_task(task_t 
 	long sleep_time = jiffies - p->last_run - 1;
 
 	if (sleep_time > 0) {
-		unsigned long runtime = jiffies - p->avg_start;
-
 		/*
 		 * Tasks that sleep a long time are categorised as idle and
 		 * will get just under interactive status with a small runtime
@@ -402,6 +400,11 @@ static inline void activate_task(task_t 
 			p->sleep_avg = MIN_SLEEP_AVG * (MAX_BONUS - INTERACTIVE_DELTA - 2) /
 				MAX_BONUS;
 		} else {
+			unsigned long runtime = jiffies - p->avg_start;
+
+			if (runtime > MAX_SLEEP_AVG)
+				runtime = MAX_SLEEP_AVG;
+
 			/*
 			 * This code gives a bonus to interactive tasks.
 			 *


             reply	other threads:[~2003-07-17  1:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-17  2:13 Con Kolivas [this message]
2003-07-17  2:39 ` Wade
2003-07-17  7:45 ` Felipe Alfaro Solana
2003-07-17  7:53   ` Con Kolivas
     [not found] ` <20030717045435.GA630@lorien.emufarm.org>
     [not found]   ` <200307171712.20193.kernel@kolivas.org>
     [not found]     ` <200307171635.25730.kernel@kolivas.org>
2003-07-17  8:04       ` Danek Duvall
2003-07-17  8:21         ` Con Kolivas
2003-07-17  8:52           ` Eugene Teo
2003-07-17  9:06           ` Mike Galbraith
2003-07-18  7:07         ` Danek Duvall
2003-07-18  9:40           ` Rudo Thomas
2003-07-18  9:45             ` Zwane Mwaikambo
2003-07-18 14:43           ` Valdis.Kletnieks
2003-07-18 14:47             ` Danek Duvall
2003-07-18 14:52             ` Con Kolivas

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=200307171213.02643.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=akpm@osdl.org \
    --cc=eugene.teo@eugeneteo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neroz@ii.net \
    --cc=wodecki@gmx.de \
    --subject='Re: [PATCH] O6.1int' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).