lkml.org 
[lkml]   [2002]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [o(1) sched J0] higher priority smaller timeslices, in fact
On Wed, 16 Jan 2002, Alexei Podtelezhnikov wrote:

>
> The comment and the actual macros are inconsistent.
> positive number * (19-n) is a decreasing function of n!

# man nice


> + * The higher a process's priority, the bigger timeslices
> + * it gets during one round of execution. But even the lowest
> + * priority process gets MIN_TIMESLICE worth of execution time.
> + */
>
> -#define NICE_TO_TIMESLICE(n) (MIN_TIMESLICE + \
> - ((MAX_TIMESLICE - MIN_TIMESLICE) * (19 - (n))) / 39)
> +#define NICE_TO_TIMESLICE(n) (MIN_TIMESLICE + \
> + ((MAX_TIMESLICE - MIN_TIMESLICE) * (19-(n))) / 39)
>
> I still suggest a different set as faster and more readable at least to
> me. Just two operations instead of 4!

this seems quite readable to me, it's the equation at page 1 of any know
linear geometry book.




- Davide


-
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 13:23    [from the cache]
©2003-2011 Jasper Spaans