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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 3 Apr 2008 14:07:32 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Roman Zippel <zippel@...ux-m68k.org>
Cc:	johnstul@...ibm.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] Introduce clocksource_forward_now

On Wed, 2 Apr 2008 13:39:43 +0200 (CEST)
Roman Zippel <zippel@...ux-m68k.org> wrote:

> Hi,
> 
> On Tue, 18 Mar 2008, john stultz wrote:
> 
> > My solution is to introduce CLOCK_MONOTONIC_RAW. This exposes a
> > nanosecond based time value, that increments starting at bootup and has
> > no frequency adjustments made to it what so ever.
> 
> There is a problem with the time offset since the last update_wall_time() 
> call, which isn't taken into account when switching clocks (possibly 
> during suspend/resume too), so that the clock might jump back during a 
> clock switch.
> To avoid making the whole more complex it's better to do small cleanup 
> first, so this patch introduces clocksource_forward_now() which takes care 
> of this offset since the last update_wall_time() call and adds it to the 
> clock, so there is no need anymore to deal with it explicitly.
> This is also gets rid of the timekeeping_suspend_nsecs hack, instead of 
> waiting until resume, the value is accumulated during suspend. In the end 
> there is only a single user of __get_nsec_offset() left, so I integrated 
> it back to getnstimeofday().
> 

It's unclear what tree this was agaisnt, but it was the wrong one.

> --- linux-2.6.orig/kernel/time/timekeeping.c
> +++ linux-2.6/kernel/time/timekeeping.c

Hopefully these changes will work when mixed with the pending 2.6.26
changes, but nobody yet knows.

> @@ -459,10 +452,10 @@ void update_wall_time(void)
>  	 */
>  	while (offset >= clock->cycle_interval) {
>  		/* accumulate one interval */
> -		clock->xtime_nsec += clock->xtime_interval;
> -		clock->cycle_last += clock->cycle_interval;
>  		offset -= clock->cycle_interval;
> +		clock->cycle_last += clock->cycle_interval;
>  
> +		clock->xtime_nsec += clock->xtime_interval;
>  		if (clock->xtime_nsec >= (u64)NSEC_PER_SEC << clock->shift) {
>  			clock->xtime_nsec -= (u64)NSEC_PER_SEC << clock->shift;
>  			xtime.tv_sec++;

This do-nothing change conflited with
clocksource-introduce-clock_monotonic_raw.patch (and fixes).  Please check
that the result is OK (ie: clocksource.raw_snsec ddd not need any changes)


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