Hi.

Reading through kernel/sched.c I came across this block (on line 597):

        {
                cycles_t t, this_slice;

                t = get_cycles();
                this_slice = t - sched_data->last_schedule;
                sched_data->last_schedule = t;
        }

It seems to me that this_slice is somewhat unused in its scope and 
therefore I propose that the block is replaced by

        sched_data->last_schedule = get_cycles();

Patch:

--- linux-240-test10-pre4-clean/kernel/sched.c  Thu Oct 19 21:19:50 2000
+++ linux.test/kernel/sched.c   Tue Oct 24 23:44:25 2000
@@ -594,13 +594,8 @@
         * and it's approximate, so we do not have to maintain
         * it while holding the runqueue spinlock.
         */
-       {
-               cycles_t t, this_slice;
 
-               t = get_cycles();
-               this_slice = t - sched_data->last_schedule;
-               sched_data->last_schedule = t;
-       }
+       sched_data->last_schedule = get_cycles();
 
        /*
         * We drop the scheduler lock early (it's a global spinlock),


The fact that the scheduler probably have been examined many times
by people far more knowledgeable that me makes the probability that
this is wrong pretty big. In that case I would like to know what use
this_slice has, if somebody would care to share.

Please also note, if the patch is considered valid, that I haven't
touched the surrounding comments. Ideas to what to do with them
would be appreciated.

-- 
Regards,
        Rasmus([EMAIL PROTECTED])

Are they taking DDT?
                -- Vice President Dan Quayle asking doctors at a Manhattan
                   AIDS clinic about their treatments of choice, 4/30/92
                   (reported in Esquire, 8/92, and NY Post early May 92)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to