ia64/xen-unstable

changeset 9246:2625000d3145

Make time-backwarsd warning a run-time configurable option.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Mar 13 13:03:18 2006 +0100 (2006-03-13)
parents 1439cfa5ee8c
children 68915c4893ee
files linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c	Mon Mar 13 11:47:56 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c	Mon Mar 13 13:03:18 2006 +0100
     1.3 @@ -157,6 +157,15 @@ static int __init __independent_wallcloc
     1.4  }
     1.5  __setup("independent_wallclock", __independent_wallclock);
     1.6  
     1.7 +/* Permitted clock jitter, in usecs, beyond which a warning will be printed. */
     1.8 +static unsigned long permitted_clock_jitter = 10000UL;
     1.9 +static int __init __permitted_clock_jitter(char *str)
    1.10 +{
    1.11 +	permitted_clock_jitter = simple_strtoul(str, NULL, 0);
    1.12 +	return 1;
    1.13 +}
    1.14 +__setup("permitted_clock_jitter=", __permitted_clock_jitter);
    1.15 +
    1.16  int tsc_disable __devinitdata = 0;
    1.17  
    1.18  static void delay_tsc(unsigned long loops)
    1.19 @@ -632,7 +641,8 @@ irqreturn_t timer_interrupt(int irq, voi
    1.20  		} while (sched_time != runstate->state_entry_time);
    1.21  	} while (!time_values_up_to_date(cpu));
    1.22  
    1.23 -	if ((unlikely(delta < -1000000LL) || unlikely(delta_cpu < 0))
    1.24 +	if ((unlikely(delta < -(s64)permitted_clock_jitter) ||
    1.25 +	     unlikely(delta_cpu < -(s64)permitted_clock_jitter))
    1.26  	    && printk_ratelimit()) {
    1.27  		printk("Timer ISR/%d: Time went backwards: "
    1.28  		       "delta=%lld cpu_delta=%lld shadow=%lld "
    1.29 @@ -1037,13 +1047,31 @@ void local_teardown_timer(unsigned int c
    1.30   * now however.
    1.31   */
    1.32  static ctl_table xen_subtable[] = {
    1.33 -	{1, "independent_wallclock", &independent_wallclock,
    1.34 -	 sizeof(independent_wallclock), 0644, NULL, proc_dointvec},
    1.35 -	{0}
    1.36 +	{
    1.37 +		.ctl_name	= 1,
    1.38 +		.procname	= "independent_wallclock",
    1.39 +		.data		= &independent_wallclock,
    1.40 +		.maxlen		= sizeof(independent_wallclock),
    1.41 +		.mode		= 0644,
    1.42 +		.proc_handler	= proc_dointvec
    1.43 +	},
    1.44 +	{
    1.45 +		.ctl_name	= 2,
    1.46 +		.procname	= "permitted_clock_jitter",
    1.47 +		.data		= &permitted_clock_jitter,
    1.48 +		.maxlen		= sizeof(permitted_clock_jitter),
    1.49 +		.mode		= 0644,
    1.50 +		.proc_handler	= proc_doulongvec_minmax
    1.51 +	},
    1.52 +	{ 0 }
    1.53  };
    1.54  static ctl_table xen_table[] = {
    1.55 -	{123, "xen", NULL, 0, 0555, xen_subtable},
    1.56 -	{0}
    1.57 +	{
    1.58 +		.ctl_name	= 123,
    1.59 +		.procname	= "xen",
    1.60 +		.mode		= 0555,
    1.61 +		.child		= xen_subtable},
    1.62 +	{ 0 }
    1.63  };
    1.64  static int __init xen_sysctl_init(void)
    1.65  {