linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] trivial change in kernel/sched.c in 2.6.0-test9+
@ 2003-11-26  5:27 Pat Erley
  2003-11-26  5:55 ` Muli Ben-Yehuda
  0 siblings, 1 reply; 5+ messages in thread
From: Pat Erley @ 2003-11-26  5:27 UTC (permalink / raw)
  To: linux-kernel

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);
 }


-- 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-11-27 16:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-26  5:27 [patch] trivial change in kernel/sched.c in 2.6.0-test9+ Pat Erley
2003-11-26  5:55 ` Muli Ben-Yehuda
2003-11-26  6:07   ` s0be
2003-11-26 11:02     ` Muli Ben-Yehuda
2003-11-27 16:46       ` Pat Erley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).