lkml.org 
[lkml]   [2004]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: time slice cfq comments
On Sat, Dec 11 2004, Con Kolivas wrote:
> Hi Jens
>
> Just thought I'd make a few comments about some of the code in your time
> sliced cfq.
>
> + if (p->array)
> + return min(cpu_curr(task_cpu(p))->time_slice,
> + (unsigned int)MAX_SLEEP_AVG);
>
> MAX_SLEEP_AVG is basically 10 * the average time_slice so this will
> always return task_cpu(p)->time_slice as the min value (except for the
> race you described in your comments). What you probably want is
>
> + return min(cpu_curr(task_cpu(p))->time_slice,
> + (unsigned int)DEF_TIMESLICE);
>
>
> Further down you do:
> + /*
> + * for blocked tasks, return half of the average sleep time.
> + * (because this is the average sleep-time we'll see if we
> + * sample the period randomly.)
> + */
> + return NS_TO_JIFFIES(p->sleep_avg) / 2;
>
> unfortunately p->sleep_avg is a non-linear value (weighted upwards
> towards MAX_SLEEP_AVG). I suspect here you want
>
> + return NS_TO_JIFFIES(p->sleep_avg) / MAX_BONUS;
>
> I don't see any need for / 2.

Ingo donoted that code, perhaps he would like to comment?

--
Jens Axboe

-
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 14:08    [W:3.355 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site