From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [sched] [patch] activate-task-speedup-2.5.3-pre2-A0
Date: Sun, 20 Jan 2002 14:18:54 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.33.0201201418320.7972-200000@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.33.0201201414080.7972-100000@localhost.localdomain>
[-- 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);
prev parent reply other threads:[~2002-01-20 11:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-20 13:15 Ingo Molnar
2002-01-20 13:18 ` Ingo Molnar [this message]
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=Pine.LNX.4.33.0201201418320.7972-200000@localhost.localdomain \
--to=mingo@elte.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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®