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]
Date:	Thu, 30 Jul 2009 14:02:14 -0700
From:	john stultz <johnstul@...ibm.com>
To:	Martin Schwidefsky <schwidefsky@...ibm.com>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Daniel Walker <dwalker@...o99.com>
Subject: Re: [RFC][patch 01/12] introduce timekeeping_leap_insert

On Wed, 2009-07-29 at 15:41 +0200, Martin Schwidefsky wrote:
> plain text document attachment (leap_insert.diff)
> From: john stultz <johnstul@...ibm.com>
> 
> ---
>  include/linux/time.h      |    1 +
>  kernel/time/ntp.c         |    7 ++-----
>  kernel/time/timekeeping.c |    7 +++++++
>  3 files changed, 10 insertions(+), 5 deletions(-)


Signed-off-by: John Stultz <johnstul@...ibm.com>

-john


> Index: linux-2.6/include/linux/time.h
> ===================================================================
> --- linux-2.6.orig/include/linux/time.h
> +++ linux-2.6/include/linux/time.h
> @@ -147,6 +147,7 @@ extern struct timespec timespec_trunc(st
>  extern int timekeeping_valid_for_hres(void);
>  extern void update_wall_time(void);
>  extern void update_xtime_cache(u64 nsec);
> +extern void timekeeping_leap_insert(int leapsecond);
> 
>  struct tms;
>  extern void do_sys_times(struct tms *);
> Index: linux-2.6/kernel/time/ntp.c
> ===================================================================
> --- linux-2.6.orig/kernel/time/ntp.c
> +++ linux-2.6/kernel/time/ntp.c
> @@ -194,8 +194,7 @@ static enum hrtimer_restart ntp_leap_sec
>  	case TIME_OK:
>  		break;
>  	case TIME_INS:
> -		xtime.tv_sec--;
> -		wall_to_monotonic.tv_sec++;
> +		timekeeping_leap_insert(-1);
>  		time_state = TIME_OOP;
>  		printk(KERN_NOTICE
>  			"Clock: inserting leap second 23:59:60 UTC\n");
> @@ -203,9 +202,8 @@ static enum hrtimer_restart ntp_leap_sec
>  		res = HRTIMER_RESTART;
>  		break;
>  	case TIME_DEL:
> -		xtime.tv_sec++;
> +		timekeeping_leap_insert(1);
>  		time_tai--;
> -		wall_to_monotonic.tv_sec--;
>  		time_state = TIME_WAIT;
>  		printk(KERN_NOTICE
>  			"Clock: deleting leap second 23:59:59 UTC\n");
> @@ -219,7 +217,6 @@ static enum hrtimer_restart ntp_leap_sec
>  			time_state = TIME_OK;
>  		break;
>  	}
> -	update_vsyscall(&xtime, clock);
> 
>  	write_sequnlock(&xtime_lock);
> 
> Index: linux-2.6/kernel/time/timekeeping.c
> ===================================================================
> --- linux-2.6.orig/kernel/time/timekeeping.c
> +++ linux-2.6/kernel/time/timekeeping.c
> @@ -58,6 +58,13 @@ void update_xtime_cache(u64 nsec)
> 
>  struct clocksource *clock;
> 
> +/* must hold xtime_lock */
> +void timekeeping_leap_insert(int leapsecond)
> +{
> +	xtime.tv_sec += leapsecond;
> +	wall_to_monotonic.tv_sec -= leapsecond;
> +	update_vsyscall(&xtime, clock);
> +}
> 
>  #ifdef CONFIG_GENERIC_TIME
>  /**
> 

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