From: Con Kolivas <kernel@kolivas.org>
To: linux kernel mailing list <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>
Subject: [PATCH] smt-nice-opt 2.6.4-rc1-mm2
Date: Sat, 6 Mar 2004 14:51:58 +1100 [thread overview]
Message-ID: <200403061452.03118.kernel@kolivas.org> (raw)
[-- Attachment #1: Type: Text/Plain, Size: 1189 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This patch optimises the smt-nice branch points
The first hunk removes one unnecessary if() and rearranges the order from
least to most likely.
The second hunk improves the "reschedule sibling task" logic substantially by
only rescheduling it if it is supposed to be put to sleep as well. This
causes far less context switching of low priority tasks.
Consequently the benchmark results are substantial:
up is uniprocessor
mm1 is before the smt nice patch
sn is with smt nice patch
opt is with this optimise patch
Time is in seconds
Concurrent kernel compiles, one make, the other nice +19 make
Nice0 Nice19
up 183 235
mm1 208 211
sn 180 237
opt 178 222
As can be seen the original patch simply changed the performance to that of
running in uniprocessor when there was a nice difference. With this patch the
overall throughput is improved compared to up as is desired by smt
processing.
Con
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFASUreZUg7+tp6mRURArj2AJ43WSCKOoKTjgXThNmizm1u2+bbGgCfXSWQ
25D55s+73IVd1/ap0QmayZk=
=5rc/
-----END PGP SIGNATURE-----
[-- Attachment #2: sched-smt-nice-opt.patch --]
[-- Type: text/x-diff, Size: 1214 bytes --]
--- linux-2.6.4-rc1-mm2/kernel/sched.c 2004-03-06 02:17:25.000000000 +1100
+++ linux-2.6.4-rc1-mm2-so/kernel/sched.c 2004-03-06 14:28:10.094227754 +1100
@@ -2002,11 +2002,9 @@ static inline int dependent_sleeper(runq
* task from using an unfair proportion of the
* physical cpu's resources. -ck
*/
- if (p->mm && smt_curr->mm && !rt_task(p) &&
- ((p->static_prio > smt_curr->static_prio &&
- (smt_curr->time_slice * (100 - sd->per_cpu_gain) /
- 100) > task_timeslice(p)) ||
- rt_task(smt_curr)))
+ if (((smt_curr->time_slice * (100 - sd->per_cpu_gain) / 100) >
+ task_timeslice(p) || rt_task(smt_curr)) &&
+ p->mm && smt_curr->mm && !rt_task(p))
ret |= 1;
/*
@@ -2014,9 +2012,9 @@ static inline int dependent_sleeper(runq
* or wake it up if it has been put to sleep for priority
* reasons.
*/
- if ((smt_curr != smt_rq->idle &&
- smt_curr->static_prio > p->static_prio) ||
- (rt_task(p) && !rt_task(smt_curr)) ||
+ if ((((p->time_slice * (100 - sd->per_cpu_gain) / 100) >
+ task_timeslice(smt_curr) || rt_task(p)) &&
+ smt_curr->mm && p->mm && !rt_task(smt_curr)) ||
(smt_curr == smt_rq->idle && smt_rq->nr_running))
resched_task(smt_curr);
}
reply other threads:[~2004-03-06 3:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200403061452.03118.kernel@kolivas.org \
--to=kernel@kolivas.org \
--cc=akpm@osdl.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