lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANqCtQK=H_B04A7knZSiuE5RLogTgMKxwtMK1HSqSgKA_U2J7A@mail.gmail.com>
Date:	Mon, 1 Aug 2011 20:08:19 +0200
From:	Remy Bohmer <linux@...mer.net>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
Cc:	Remy Bohmer <l.pinguin@...il.com>, Arnd Bergmann <arnd@...db.de>,
	Nicolas Pitre <nicolas.pitre@...aro.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	linux-kernel@...r.kernel.org, tglx@...utronix.de,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>,
	Andrew Victor <linux@...im.org.za>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] Add sched_clock to AT91 TCB clocksource driver

Hi,

> You're forgetting that jiffies doesn't jump about.  A late initializing
> sched_clock could jump.

Agreed. Currently the jiffies based clock does not move at all, thus
it surely does not jump... ;-)

>> Anyway, do you have a better suggestion how to fix this? The tcb
>> clocksource is loaded during a arch_initcall(), perhaps we need
>> something before that point.
>> I do not see an easy way to integrate it in MACHINE_START(.timer).
>> Would 'late_time_init' be a better solution?
>
> late_time_init() is not that much better as that still happens after
> sched_init() has been called.  sched_init() initializes various
> structures which involves reading sched_clock().

But late_time_init does it before the sched_clock is declared stable.
Until that point sched_clock will always return zero, as such we can
IMHO safely assume that the scheduler is designed such that it can
handle fixed zero timestamps for a while. The new sched_clock also
nicely starts counting from zero once enabled, and does not make a
jump start.

> Why can't it initialize itself at the standard point during the boot
> sequence, which is time_init() - which in turn is as you say the
> .timer callback?

In that case it has to replace the PIT based clocksource completely.
Since the TCB based clocksource and event device are
optional/configurable for this architecture and it is implemented as a
clocksource driver instead of part of the BSP, it would result in a
lot of ifdefs throughout that code.
The arch_initcall() has to be removed and replaced by something else...
I will try to work out a different solution, and post an update, see
how that looks like...

Kind regards,

Remy
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ