lkml.org 
[lkml]   [2013]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] sched: Update rq clock on nohz CPU before migrating tasks

* Frederic Weisbecker <fweisbec@gmail.com> wrote:

> @@ -1115,6 +1116,12 @@ static inline void dec_nr_running(struct rq *rq)
>
> extern void update_rq_clock(struct rq *rq);
>
> +static inline void update_nohz_rq_clock(struct rq *rq)
> +{
> + if (tick_nohz_extended_cpu(cpu_of(rq)))
> + update_rq_clock(rq);
> +}

A minor comment: instead of implicitly knowing that full nohz CPUs mean a stale
rq_clock, how about adding this information to the rq-> itself?

Something like introducing rq->clock_valid, initializing it to 1, and setting it
to 0 when a CPU stops the tick.

(This would also allow the debug detection of sched_clock() use of stale values.)

We already have a similar flag: rq->skip_clock_update. I'd suggest to introduce a
'struct sched_clock' helper structure and add the flags and scheduler clock fields
as:

rq->clock -> rq->clock.cpu
rq->clock_task -> rq->clock.task
rq->clock_valid -> rq->clock.valid
rq->clock_skip_uipdate -> rq->clock.skip_update
rq->hrtick_timer -> rq->clock.hrtick_timer

rq->prev_irq_time -> rq->clock.prev_irq_time
rq->prev_steal_time -> rq->clock.prev_steal_time
rq->prev_steal_time_rq -> rq->clock.prev_steal_time_rq

Thanks,

ngo


\
 
 \ /
  Last update: 2013-04-08 14:21    [W:0.153 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site