* [PATCH] smt-nice-opt 2.6.4-rc1-mm2
@ 2004-03-06 3:51 Con Kolivas
0 siblings, 0 replies; only message in thread
From: Con Kolivas @ 2004-03-06 3:51 UTC (permalink / raw)
To: linux kernel mailing list; +Cc: Andrew Morton
[-- 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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-03-06 3:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-06 3:51 [PATCH] smt-nice-opt 2.6.4-rc1-mm2 Con Kolivas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox