[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180730123631.GO2476@hirez.programming.kicks-ass.net>
Date: Mon, 30 Jul 2018 14:36:31 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Pavel Tatashin <pasha.tatashin@...cle.com>
Cc: Guenter Roeck <linux@...ck-us.net>,
LKML <linux-kernel@...r.kernel.org>, mingo@...nel.org,
tglx@...utronix.de, hpa@...or.com,
linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/timers] sched/clock: Enable sched clock early
On Tue, Jul 24, 2018 at 10:41:19PM -0400, Pavel Tatashin wrote:
> If we need it, we can surround the sched_clock_register() with
> local_irq_disable/local_irq_enable:
>
> diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c
> index cbc72c2c1fca..5015b165b55b 100644
> --- a/kernel/time/sched_clock.c
> +++ b/kernel/time/sched_clock.c
> @@ -243,8 +243,11 @@ void __init generic_sched_clock_init(void)
> * If no sched_clock() function has been provided at that point,
> * make it the final one one.
> */
> - if (cd.actual_read_sched_clock == jiffy_sched_clock_read)
> + if (cd.actual_read_sched_clock == jiffy_sched_clock_read) {
> + local_irq_disable();
> sched_clock_register(jiffy_sched_clock_read, BITS_PER_LONG, HZ);
> + local_irq_enable();
> + }
>
> update_sched_clock();
I'm thinking maybe disable IRQs for that entire function, instead of
just the register call.
Powered by blists - more mailing lists