lkml.org 
[lkml]   [2003]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] trivial change in kernel/sched.c in 2.6.0-test9+
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.036 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site