Re: [RFC][PATCH 00/18] Increase resolution of load weights
From: Nikhil Rao
Date: Thu Apr 28 2011 - 14:33:59 EST
On Thu, Apr 28, 2011 at 5:12 AM, Srivatsa Vaddagiri
<vatsa@xxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Apr 28, 2011 at 05:18:27PM +0530, Nikunj A. Dadhania wrote:
>> --- kernel/sched.c.orig    2011-04-28 16:34:24.000000000 +0530
>> +++ kernel/sched.c  Â2011-04-28 16:36:29.000000000 +0530
>> @@ -1336,7 +1336,7 @@ calc_delta_mine(unsigned long delta_exec
>> Â Â Â Â Â Â Â Â Â Â Â lw->inv_weight = 1 + (WMULT_CONST - w/2) / (w + 1);
>> Â Â Â }
>>
>> - Â Â tmp = (u64)delta_exec * weight;
>> + Â Â tmp = (u64)delta_exec * (weight >> SCHED_LOAD_RESOLUTION);
>
> Should we be fixing inv_weight rather to account for SCHED_LOAD_RESOLUTION here?
>
Yes, I have been looking into fixing inv_weight and calc_delta_mine()
calculations based on the assumption that we have u64 weights. IMO the
function is complicated because the return value needs to be
calculated to fit into unsigned long. I would like to update users of
calc_delta_mine() to use u64 instead of unsigned longs and I think
this can be easily done (quick inspection of the code shows two call
sites that need to be updated - update_curr() and wakeup_gran()).
Without the restriction to fit into unsigned long, I think we can make
calc_delta_mine() and the inv_weight calculations simpler.
-Thanks,
Nikhil
--
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/