lkml.org 
[lkml]   [2010]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 05/22] sched: SCHED_DEADLINE policy implementation
From
Date
On Fri, 2010-10-29 at 08:30 +0200, Raistlin wrote:
> +static void update_curr_dl(struct rq *rq)
> +{
> + struct task_struct *curr = rq->curr;
> + struct sched_dl_entity *dl_se = &curr->dl;
> + u64 delta_exec;
> +
> + if (!dl_task(curr) || !on_dl_rq(dl_se))
> + return;
> +
> + delta_exec = rq->clock - curr->se.exec_start;
> + if (unlikely((s64)delta_exec < 0))
> + delta_exec = 0;
> +
> + schedstat_set(curr->se.statistics.exec_max,
> + max(curr->se.statistics.exec_max, delta_exec));
> +
> + curr->se.sum_exec_runtime += delta_exec;
> + account_group_exec_runtime(curr, delta_exec);
> +
> + curr->se.exec_start = rq->clock;
> + cpuacct_charge(curr, delta_exec);
> +
> + dl_se->runtime -= delta_exec;
> + if (dl_runtime_exceeded(rq, dl_se)) {
> + __dequeue_task_dl(rq, curr, 0);
> + if (likely(start_dl_timer(dl_se)))
> + dl_se->dl_throttled = 1;
> + else
> + enqueue_task_dl(rq, curr, ENQUEUE_REPLENISH);
> +
> + resched_task(curr);
> + }
> +}

So you keep the current task in the rb-tree? If you remove the current
task from the tree you don't have to do the whole dequeue/enqueue thing.
Then again, I guess it only really matters once you push the deadline,
which shouldn't be that often.

Also, you might want to put a conditional around that resched, no point
rescheduling if you're still the leftmost task.




\
 
 \ /
  Last update: 2010-11-11 15:19    [W:0.748 / U:1.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site