[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130408114851.GA3928@gmail.com>
Date: Mon, 8 Apr 2013 13:48:51 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Alessio Igor Bogani <abogani@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Chris Metcalf <cmetcalf@...era.com>,
Christoph Lameter <cl@...ux.com>,
Geoff Levand <geoff@...radead.org>,
Gilad Ben Yossef <gilad@...yossef.com>,
Hakan Akkan <hakanakkan@...il.com>,
Li Zhong <zhong@...ux.vnet.ibm.com>,
Namhyung Kim <namhyung.kim@....com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
Paul Turner <pjt@...gle.com>, Mike Galbraith <efault@....de>
Subject: Re: [PATCH 1/7] sched: Update rq clock on nohz CPU before migrating
tasks
* Frederic Weisbecker <fweisbec@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists