mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [sched] [patch] activate-task-speedup-2.5.3-pre2-A0
@ 2002-01-20 13:15 Ingo Molnar
  2002-01-20 13:18 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Molnar @ 2002-01-20 13:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel


the attached patch against 2.5.3-pre2 is an optimization of
activate_task(), to not call effective_prio() if no jiffy passed since
->sleep_timestamp was updated. This optimizes high-frequency wakeups.

	Ingo


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [sched] [patch] activate-task-speedup-2.5.3-pre2-A0
  2002-01-20 13:15 [sched] [patch] activate-task-speedup-2.5.3-pre2-A0 Ingo Molnar
@ 2002-01-20 13:18 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2002-01-20 13:18 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 247 bytes --]


> the attached patch against 2.5.3-pre2 is an optimization of
> activate_task(), to not call effective_prio() if no jiffy passed since
> ->sleep_timestamp was updated. This optimizes high-frequency wakeups.

[attached for real this time.]

	Ingo

[-- Attachment #2: Type: TEXT/PLAIN, Size: 787 bytes --]

--- linux/kernel/sched.c.orig	Sun Jan 20 11:37:04 2002
+++ linux/kernel/sched.c	Sun Jan 20 11:37:21 2002
@@ -126,9 +126,10 @@
 
 static inline void activate_task(task_t *p, runqueue_t *rq)
 {
+	unsigned long sleep_time = jiffies - p->sleep_timestamp;
 	prio_array_t *array = rq->active;
 
-	if (!rt_task(p)) {
+	if (!rt_task(p) && sleep_time) {
 		/*
 		 * This code gives a bonus to interactive tasks. We update
 		 * an 'average sleep time' value here, based on
@@ -136,7 +137,7 @@
 		 * the higher the average gets - and the higher the priority
 		 * boost gets as well.
 		 */
-		p->sleep_avg += jiffies - p->sleep_timestamp;
+		p->sleep_avg += sleep_time;
 		if (p->sleep_avg > MAX_SLEEP_AVG)
 			p->sleep_avg = MAX_SLEEP_AVG;
 		p->prio = effective_prio(p);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-20 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-20 13:15 [sched] [patch] activate-task-speedup-2.5.3-pre2-A0 Ingo Molnar
2002-01-20 13:18 ` Ingo Molnar

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®