lkml.org 
[lkml]   [2010]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implementation.
From
Date
On Sun, 2010-02-28 at 20:17 +0100, Raistlin wrote:
> +/*
> + * Here we check if --at time t-- a task (which is probably being
> + * [re]activated or, in general, enqueued) can use its remaining runtime
> + * and its current deadline _without_ exceeding the bandwidth it is
> + * assigned (function returns true if it can).
> + *
> + * For this to hold, we must check if:
> + * runtime / (deadline - t) < dl_runtime / dl_deadline .
> + */
> +static bool dl_check_bandwidth(struct sched_dl_entity *dl_se, u64 t)
> +{
> + u64 left, right;
> +
> + /*
> + * left and right are the two sides of the equation above,
> + * after a bit of shuffling to use multiplications instead
> + * of divisions.
> + */
> + left = dl_se->dl_deadline * dl_se->runtime;
> + right = (dl_se->deadline - t) * dl_se->dl_runtime;
> +
> + return dl_time_before(left, right);
> +}

So what happens when we overflow u64?


\
 
 \ /
  Last update: 2010-04-13 20:25    [W:0.091 / U:1.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site