linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pat Erley <paterley@mail.drunkencodepoets.com>
To: linux-kernel@vger.kernel.org
Subject: [patch] trivial change in kernel/sched.c in 2.6.0-test9+
Date: Wed, 26 Nov 2003 00:27:13 -0500	[thread overview]
Message-ID: <20031126002713.1f8707f8.paterley@mail.drunkencodepoets.com> (raw)

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


-- 

             reply	other threads:[~2003-11-26  5:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-26  5:27 Pat Erley [this message]
2003-11-26  5:55 ` [patch] trivial change in kernel/sched.c in 2.6.0-test9+ Muli Ben-Yehuda
2003-11-26  6:07   ` s0be
2003-11-26 11:02     ` Muli Ben-Yehuda
2003-11-27 16:46       ` Pat Erley

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=20031126002713.1f8707f8.paterley@mail.drunkencodepoets.com \
    --to=paterley@mail.drunkencodepoets.com \
    --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;
as well as URLs for NNTP newsgroup(s).