[patch] trivial change in kernel/sched.c in 2.6.0-test9+

From: Pat Erley
Date: Wed Nov 26 2003 - 00:29:00 EST


this ends up saving a few math operations any time a child
process exits. ( calling sched_exit(task_t * p) )

here's my exact comment on the contents of the patch (left
out of the actual patch)

/*
* the funcion below was origionally this, for anyone
* wondering what I changed. I mearly used some algebra
* to factor out a 1 / (EXIT_WEIGHT + 1)
*
* p->parent->sleep_avg = p->parent->sleep_avg /
* (EXIT_WEIGHT + 1) * EXIT_WEIGHT + p->sleep_avg /
* (EXIT_WEIGHT + 1);
*
* the only possible effects I see this having are:
*
* 1. less math operations for each child process exiting
* 2. higher accuracy in the value of p->parent->sleep_avg
* due to using only 1 division over 2
*
*/

patches clean(a little offset, but no fuzz) on test9, test9-mms,
test10, test10-mm1

Pat Erley

/*************** patch follows ******************/


--- linux-2.6.0-test9/kernel/sched.c 2003-11-23 02:33:34.000000000 -0500
+++ linux/kernel/sched.c 2003-11-23 02:47:29.730649061 -0500
@@ -720,8 +720,8 @@
* the sleep_avg of the parent as well.
*/
if (p->sleep_avg < p->parent->sleep_avg)
- p->parent->sleep_avg = p->parent->sleep_avg /
- (EXIT_WEIGHT + 1) * EXIT_WEIGHT + p->sleep_avg /
+ p->parent->sleep_avg = ( p->parent->sleep_avg *
+ EXIT_WEIGHT + p->sleep_avg ) /
(EXIT_WEIGHT + 1);
}


--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/