i386 no idle hz - aka dynticks v051118-1
Subsystems (2)
PATCH 1/1 i386 no idle hz - aka dynticks v051118-1
Here is a complete respin of the dynamic ticks code for i386.
I thank Srivatsa Vaddagiri for attempting to unify the dyntick interfaces, and Russell King for suggestions on unifying it based on the arm code. Other dynticks versions have appeared sporadically for x86_64 and ppc64 without reference to the unified base. As the i386 code still has the beginnings of a unified dynticks, I have updated the i386 dynticks with this in mind, and hopefully unity can still be achieved in the future.
I've changed the portion of the arch independent code to resemble the arm base more closely with struct members of dyn_tick_timer, and extra members that may be helpful in other arches.
I've performed numerous cleanups and optimisations.
The timer reprogramming accuracy was improved.
The sys/ interface was made to resemble the arm one with a simple entry for on and off in/sys/devices/system/timer/timer0/dyn_tick
as the other entries were redundant and it makes sense to be consistent.
i386 NO_IDLE_HZ now selects the pm_timer rather than is dependent on it since it is the only timer which can maintain accuracy with dynticks enabled.
So far this version seems to boot and run fine, but there are at least 2 places in the kernel that need to be made aware of the fact they're running dynticks; the ondemand scaling governor and the bus mastering code (as pointed out by Tytso). Both don't realise the few ticks that have passed are quite some distance apart and overestimate the load grossly. They are not harmful, but lead to increase in power usage instead of a decrease. I have yet to investigate that code portion to see what needs to be done
The current patch is a series of 3 patches and a rollup and the split-out patches are all available here:
http://ck.kolivas.org/patches/dyn-ticks/
Attached is a rollup of the 3 patches for 2.6.15-rc1 to provide dynticks for i386
Please test and report, and feel free to provide code hints for ondemand and bus mastering :D
Cheers,
Con
arch/i386/Kconfig +16 -0
@@ -173,6 +173,22 @@ config HPET_EMULATE_RTC depends on HPET_TIMER && RTC=y default y +config NO_IDLE_HZ + bool "Dynamic Tick Timer - Skip timer ticks during idle" + depends on EXPERIMENTAL + select X86_PM_TIMER + help + This option enables support for skipping timer ticks when the + processor is idle. During system load, timer is continuous. + This option saves power, as it allows the system to stay in + idle mode longer. Currently the only supported timer is ACPI PM + timer. TSC and HPET timers are not supported. + + Note that you can disable dynamic tick timer either by + passing dyntick=disable command line option, or via sysfs: + + # echo 0 > /sys/devices/system/dyn_tick/dyn_tick0/enable + config SMP bool "Symmetric multi-processing support" ---help---
arch/i386/defconfig +1 -0
@@ -91,6 +91,7 @@ CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y # CONFIG_HPET_TIMER is not set # CONFIG_HPET_EMULATE_RTC is not set +# CONFIG_NO_IDLE_HZ is not set CONFIG_SMP=y CONFIG_NR_CPUS=8 CONFIG_SCHED_SMT=y
arch/i386/kernel/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-$(CONFIG_MODULES) += module.o obj-y += sysenter.o vsyscall.o obj-$(CONFIG_ACPI_SRAT) += srat.o obj-$(CONFIG_HPET_TIMER) += time_hpet.o +obj-$(CONFIG_NO_IDLE_HZ) += dyn-tick.o obj-$(CONFIG_EFI) += efi.o efi_stub.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/i386/kernel/apic.c +30 -1
@@ -26,6 +26,7 @@#include <linux/kernel_stat.h> #include <linux/sysdev.h> #include <linux/cpu.h> +#include <linux/dyn-tick.h> #include <asm/atomic.h> #include <asm/smp.h>
@@ -932,6 +933,9 @@ void (*wait_timer_tick)(void) __devinitd#define APIC_DIVISOR 16 +static u32 apic_timer_val; +#define APIC_TIMER_VAL ((apic_timer_val) / (HZ)) +static void __setup_APIC_LVTT (unsigned int clocks) {unsigned int lvtt_value, tmp_value, ver;
@@ -950,7 +954,9 @@ static void __setup_APIC_LVTT(unsigned i & ~(APIC_TDR_DIV_1 | APIC_TDR_DIV_TMBASE)) | APIC_TDR_DIV_16); -apic_write_around (APIC_TMICT , clocks/APIC_DIVISOR ); + apic_timer_val = clocks *HZ /APIC_DIVISOR ; + +apic_write_around (APIC_TMICT ,APIC_TIMER_VAL ); }static void __devinit setup_APIC_timer (unsigned int clocks)
@@ -969,6 +975,17 @@ static void __devinit setup_APIC_timer(ulocal_irq_restore (flags); } +/* Used by NO_IDLE_HZ to skip ticks on idle CPUs */ +void reprogram_apic_timer (unsigned long count) +{ +unsigned long flags; + + count = count * apic_timer_val /HZ ; +local_irq_save (flags); +apic_write_around (APIC_TMICT , count); +local_irq_restore (flags); +} +/* * In this function we calibrate APIC bus clocks to the external * timer. Unfortunately we cannot use jiffies and the timer irq
@@ -1064,6 +1081,9 @@ void __init setup_boot_APIC_clock(void)*/ setup_APIC_timer (calibration_result); +setup_dyn_tick_use_apic (calibration_result); +set_dyn_tick_max_skip ((0xFFFFFFFF / calibration_result) *APIC_DIVISOR ); +local_irq_restore (flags); }
@@ -1202,6 +1222,9 @@ fastcall void smp_apic_timer_interrupt(s* interrupt lock, which is the WrongThing (tm) to do. */ irq_enter (); + +dyn_tick_interrupt (LOCAL_TIMER_VECTOR , regs); +smp_local_timer_interrupt (regs);irq_exit (); }
@@ -1214,6 +1237,9 @@ fastcall void smp_spurious_interrupt(strunsigned long v;irq_enter (); + +dyn_tick_interrupt (SPURIOUS_APIC_VECTOR , regs); +/* * Check if this really is a spurious interrupt and ACK it * if it is a vectored one. Just in case...
@@ -1238,6 +1264,9 @@ fastcall void smp_error_interrupt(structunsigned long v, v1;irq_enter (); + +dyn_tick_interrupt (ERROR_APIC_VECTOR , regs); +/* First tickle the hardware, only then report what went on. -- REW */ v =apic_read (APIC_ESR );apic_write (APIC_ESR ,0 );
arch/i386/kernel/dyn-tick.c new file +154 -0
154 lines not on this page · raw message
arch/i386/kernel/io_apic.c +22 -3
@@ -32,6 +32,7 @@#include <linux/acpi.h> #include <linux/module.h> #include <linux/sysdev.h> +#include <linux/dyn-tick.h> #include <asm/io.h> #include <asm/smp.h>
@@ -1190,15 +1191,19 @@ static inline void ioapic_register_intr(if ((trigger ==IOAPIC_AUTO &&IO_APIC_irq_trigger (irq)) || trigger ==IOAPIC_LEVEL ) irq_desc[vector].handler = &ioapic_level_type; -else +else if (vector) irq_desc[vector].handler = &ioapic_edge_type; +else + irq_desc[vector].handler =IOAPIC_EDGE_TYPE_IRQ0 ;set_intr_gate (vector, interrupt[vector]); }else {if ((trigger ==IOAPIC_AUTO &&IO_APIC_irq_trigger (irq)) || trigger ==IOAPIC_LEVEL ) irq_desc[irq].handler = &ioapic_level_type; -else +else if (irq) irq_desc[irq].handler = &ioapic_edge_type; +else + irq_desc[irq].handler =IOAPIC_EDGE_TYPE_IRQ0 ;set_intr_gate (vector, interrupt[irq]); } }
@@ -1311,7 +1316,7 @@ static void __init setup_ExtINT_IRQ0_pin* The timer IRQ doesn't have to know that behind the * scene we have a 8259A-master in AEOI mode ... */ - irq_desc[0 ].handler = &ioapic_edge_type; + irq_desc[0 ].handler =IOAPIC_EDGE_TYPE_IRQ0 ;/* * Add it to the IO-APIC irq-routing table:
@@ -2088,6 +2093,20 @@ static struct hw_interrupt_type ioapic_l#endif }; +/* Needed to disable PIT interrupts when all CPUs sleep */ +struct hw_interrupt_type ioapic_edge_type_irq0 = { + .typename ="IO-APIC-edge-irq0" , + .startup = startup_edge_ioapic, + .shutdown = shutdown_edge_ioapic, + .enable = unmask_IO_APIC_irq, + .disable = mask_IO_APIC_irq, + .ack = ack_edge_ioapic, + .end = end_edge_ioapic, +#ifdef CONFIG_SMP + .set_affinity = set_ioapic_affinity, +#endif +}; +static inline void init_IO_APIC_traps (void ) {int irq;
arch/i386/kernel/irq.c +3 -0
@@ -18,6 +18,7 @@#include <linux/notifier.h> #include <linux/cpu.h> #include <linux/delay.h> +#include <linux/dyn-tick.h> DEFINE_PER_CPU(irq_cpustat_t, irq_stat) ____cacheline_maxaligned_in_smp;EXPORT_PER_CPU_SYMBOL (irq_stat);
@@ -76,6 +77,8 @@ fastcall unsigned int do_IRQ(struct pt_r }#endif +dyn_tick_interrupt (irq, regs); +#ifdef CONFIG_4KSTACKS curctx = (union irq_ctx *)current_thread_info ();
arch/i386/kernel/process.c +3 -0
@@ -39,6 +39,7 @@#include <linux/ptrace.h> #include <linux/random.h> #include <linux/kprobes.h> +#include <linux/dyn-tick.h> #include <asm/uaccess.h> #include <asm/pgtable.h>
@@ -193,6 +194,8 @@ void cpu_idle(void)if (cpu_is_offline (cpu))play_dead (); +idle_reprogram_timer (); +__get_cpu_var (irq_stat).idle_timestamp = jiffies;idle (); }
arch/i386/kernel/smp.c +8 -0
@@ -20,6 +20,7 @@#include <linux/interrupt.h> #include <linux/cpu.h> #include <linux/module.h> +#include <linux/dyn-tick.h> #include <asm/mtrr.h> #include <asm/tlbflush.h>
@@ -313,6 +314,8 @@ fastcall void smp_invalidate_interrupt(s {unsigned long cpu; +dyn_tick_interrupt (INVALIDATE_TLB_VECTOR , regs); + cpu =get_cpu ();if (!cpu_isset (cpu, flush_cpumask))
@@ -600,6 +603,8 @@ void smp_send_stop(void) fastcall void smp_reschedule_interrupt(struct pt_regs *regs) {ack_APIC_irq (); + +dyn_tick_interrupt (RESCHEDULE_VECTOR , regs); } fastcall void smp_call_function_interrupt(struct pt_regs *regs)
@@ -609,6 +614,9 @@ fastcall void smp_call_function_interrupint wait = call_data->wait;ack_APIC_irq (); + +dyn_tick_interrupt (CALL_FUNCTION_VECTOR , regs); +/* * Notify initiating CPU that I've grabbed the data and am * about to execute the function
arch/i386/kernel/time.c +12 -6
@@ -46,6 +46,7 @@#include <linux/bcd.h> #include <linux/efi.h> #include <linux/mca.h> +#include <linux/dyn-tick.h> #include <asm/io.h> #include <asm/smp.h>
@@ -245,7 +246,7 @@ EXPORT_SYMBOL(profile_pc);* timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -static inline void do_timer_interrupt (int irq,struct pt_regs *regs) +static inline void do_timer_interrupt (int irq,struct pt_regs *regs,int lost) {#ifdef CONFIG_X86_IO_APIC if (timer_ack) {
@@ -263,7 +264,8 @@ static inline void do_timer_interrupt(in }#endif -do_timer_interrupt_hook (regs); +if (!dyn_tick_enabled () || lost) +do_timer_interrupt_hook (regs);if (MCA_bus) {
@@ -288,6 +290,8 @@ static inline void do_timer_interrupt(in*/ irqreturn_t timer_interrupt (int irq,void *dev_id,struct pt_regs *regs) { +int lost; +/* * Here we are in the timer irq handler. We just have irqs locally * disabled but we don't know if the timer_bh is running on the other
@@ -297,9 +301,9 @@ irqreturn_t timer_interrupt(int irq, voi*/ write_seqlock (&xtime_lock); - cur_timer->mark_offset (); - -do_timer_interrupt (irq, regs); + lost = cur_timer->mark_offset (); + +do_timer_interrupt (irq, regs, lost);write_sequnlock (&xtime_lock);return IRQ_HANDLED ;
@@ -425,7 +429,7 @@ static struct sysdev_class timer_sysclas/* XXX this driverfs stuff should probably go elsewhere later -john */ -static struct sys_device device_timer = { +struct sys_device device_timer = { .id =0 , .cls = &timer_sysclass, };
@@ -481,5 +485,7 @@ void __init time_init(void) cur_timer =select_timer ();printk (KERN_INFO "Using %s for high-res timesource\n" ,cur_timer->name); +dyn_tick_time_init (cur_timer); +time_init_hook (); }
arch/i386/kernel/timers/timer_pit.c +34 -1
@@ -31,9 +31,10 @@ static int __init init_pit(char* overridreturn 0 ; } -static void mark_offset_pit (void ) +static int mark_offset_pit (void ) {/* nothing needed */ +return 1 ; }static unsigned long long monotonic_clock_pit (void )
@@ -147,6 +148,38 @@ static unsigned long get_offset_pit(voidreturn count; } +void disable_pit_timer (void ) +{ + irq_desc[0 ].handler->disable (0 ); +} + +void enable_pit_timer (void ) +{ + irq_desc[0 ].handler->enable (0 ); +} + +/* +* Reprograms the next timer interrupt +* PIT timer reprogramming code taken from APM code. +* Note that PIT timer is a 16-bit timer, which allows max +* skip of only few seconds. +*/ +void reprogram_pit_timer (unsigned long jiffies_to_skip) +{ +int skip; +extern spinlock_t i8253_lock; +unsigned long flags; + + skip = jiffies_to_skip *LATCH ; +if (skip >0xffff ) + skip =0xffff ; + +spin_lock_irqsave (&i8253_lock, flags); +outb_p (0x34 ,PIT_MODE );/* binary, mode 2, LSB/MSB, ch 0 */ +outb_p (skip &0xff ,PIT_CH0 );/* LSB */ +outb (skip >>8 ,PIT_CH0 );/* MSB */ +spin_unlock_irqrestore (&i8253_lock, flags); +}/* tsc timer_opts struct */ struct timer_opts timer_pit = {
arch/i386/kernel/timers/timer_pm.c +15 -17
@@ -15,6 +15,7 @@#include <linux/module.h> #include <linux/device.h> #include <linux/init.h> +#include <linux/dyn-tick.h> #include <asm/types.h> #include <asm/timer.h> #include <asm/smp.h>
@@ -28,7 +29,7 @@#define PMTMR_TICKS_PER_SEC 3579545#define PMTMR_EXPECTED_RATE \ ((CALIBRATE_LATCH * (PMTMR_TICKS_PER_SEC >> 10)) / (CLOCK_TICK_RATE>>10)) - +#define PMTMR_TICKS_PER_JIFFY (PMTMR_EXPECTED_RATE / (CALIBRATE_LATCH/LATCH))/* The I/O port the PMTMR resides at. * The location is detected during setup_arch(),
@@ -127,7 +128,13 @@ pm_good:if (verify_pmtmr_rate () !=0 )return -ENODEV ; +printk ("Using %u PM timer ticks per jiffy \n" ,PMTMR_TICKS_PER_JIFFY ); + + offset_tick =read_pmtmr (); +setup_pit_timer (); +init_cpu_khz (); +set_dyn_tick_max_skip (((0xFFFFFF /1000000 ) *286 *HZ ) >>10 );return 0 ; }
@@ -148,10 +155,9 @@ static inline u32 cyc2us(u32 cycles)* this gets called during each timer interrupt * - Called while holding the writer xtime_lock */ -static void mark_offset_pmtmr (void ) +static int mark_offset_pmtmr (void ) {u32 lost, delta, last_offset; -static int first_run =1 ; last_offset = offset_tick;write_seqlock (&monotonic_lock);
@@ -161,29 +167,20 @@ static void mark_offset_pmtmr(void)/* calculate tick interval */ delta = (offset_tick - last_offset) &ACPI_PM_MASK ; -/* convert to usecs */ - delta =cyc2us (delta); -/* update the monotonic base value */ - monotonic_base += delta *NSEC_PER_USEC ; + monotonic_base +=cyc2us (delta) *NSEC_PER_USEC ;write_sequnlock (&monotonic_lock);/* convert to ticks */ delta += offset_delay; - lost = delta / (USEC_PER_SEC /HZ ); - offset_delay = delta % (USEC_PER_SEC /HZ ); - + lost = delta /PMTMR_TICKS_PER_JIFFY ; + offset_delay = delta %PMTMR_TICKS_PER_JIFFY ;/* compensate for lost ticks */ if (lost >=2 ) jiffies_64 += lost -1 ; -/* don't calculate delay for first run, -or if we've got less then a tick */ -if (first_run || (lost <1 )) { - first_run =0 ; - offset_delay =0 ; - } +return lost; }static int pmtmr_resume (void )
@@ -192,6 +189,7 @@ static int pmtmr_resume(void)/* Assume this is the last mark offset time */ offset_tick =read_pmtmr ();write_sequnlock (&monotonic_lock); + offset_delay =0 ;return 0 ; }
@@ -243,7 +241,7 @@ static unsigned long get_offset_pmtmr(vo now =read_pmtmr (); delta = (now - offset)&ACPI_PM_MASK ; -return (unsigned long ) offset_delay +cyc2us (delta); +return (unsigned long )cyc2us (delta + offset_delay); }
arch/i386/kernel/timers/timer_tsc.c +30 -31
138 lines not on this page · raw message
drivers/acpi/Kconfig +2 -0
@@ -302,6 +302,8 @@ config X86_PM_TIMER voltage scaling, unlike the commonly used Time Stamp Counter (TSC) timing source. + This timer is selected by dyntick (NO_IDLE_HZ). + So, if you see messages like 'Losing too many ticks!' in the kernel logs, and/or you are using this on a notebook which does not yet have an HPET, you should say "Y" here.
include/asm-i386/apic.h +2 -0
@@ -121,6 +121,7 @@ extern void nmi_watchdog_tick (struct ptextern int APIC_init_uniprocessor (void );extern void disable_APIC_timer (void );extern void enable_APIC_timer (void ); +extern void reprogram_apic_timer (unsigned long count);extern void enable_NMI_through_LVT0 (void * dummy);
@@ -134,6 +135,7 @@ extern int disable_timer_pin_1;#else /* !CONFIG_X86_LOCAL_APIC */ static inline void lapic_shutdown (void ) { } +static inline void reprogram_apic_timer (unsigned long count) { }#endif /* !CONFIG_X86_LOCAL_APIC */
include/asm-i386/dyn-tick.h new file +96 -0
96 lines not on this page · raw message
include/asm-i386/timer.h +4 -1
@@ -19,7 +19,7 @@*/ struct timer_opts {char * name; -void (*mark_offset)(void ); +int (*mark_offset)(void );unsigned long (*get_offset)(void );unsigned long long (*monotonic_clock)(void );void (*delay)(unsigned long );
@@ -38,6 +38,9 @@ struct init_timer_opts {extern struct timer_opts *__init select_timer (void );extern void clock_fallback (void );void setup_pit_timer (void ); +extern void disable_pit_timer (void ); +extern void enable_pit_timer (void ); +extern void reprogram_pit_timer (unsigned long jiffies_to_skip);/* Modifiers for buggy PIT handling */
include/linux/dyn-tick.h new file +64 -0
64 lines not on this page · raw message
include/linux/timer.h +1 -0
@@ -97,5 +97,6 @@ static inline void add_timer(struct timeextern void init_timers (void );extern void run_local_timers (void );extern void it_real_fn (unsigned long ); +extern void conditional_run_local_timers (void );#endif
kernel/dyn-tick.c new file +190 -0
190 lines not on this page · raw message
kernel/timer.c +7 -0
@@ -869,6 +869,13 @@ void run_local_timers(void)raise_softirq (TIMER_SOFTIRQ ); } +void conditional_run_local_timers (void ) +{ +tvec_base_t *base = &__get_cpu_var (tvec_bases); + +if (base->timer_jiffies != jiffies) +run_local_timers (); +}/* * Called by the timer interrupt. xtime_lock must already be taken * by the timer IRQ!
kernel/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ obj-$(CONFIG_CRASH_DUMP) += crash_dump.o obj-$(CONFIG_SECCOMP) += seccomp.o obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o +obj-$(CONFIG_NO_IDLE_HZ) += dyn-tick.o ifneq ($(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER),y) # According to Alan Modra <[email protected]>, the -fno-omit-frame-pointer is
arch/i386/kernel/timers/timer_cyclone.c +3 -1
@@ -45,7 +45,7 @@ static seqlock_t monotonic_lock = SEQLOC }while (high != cyclone_timer[1 ]); -static void mark_offset_cyclone (void ) +static int mark_offset_cyclone (void ) {unsigned long lost, delay;unsigned long delta = last_cyclone_low;
@@ -101,6 +101,8 @@ static void mark_offset_cyclone(void)*/ if (lost &&abs (delay - delay_at_last_interrupt) > (900000 /HZ )) jiffies_64++; + +return 1 ; }static unsigned long get_offset_cyclone (void )
arch/i386/kernel/timers/timer_hpet.c +3 -1
@@ -101,7 +101,7 @@ static unsigned long get_offset_hpet(voireturn edx; } -static void mark_offset_hpet (void ) +static int mark_offset_hpet (void ) {unsigned long long this_offset, last_offset;unsigned long offset;
@@ -124,6 +124,8 @@ static void mark_offset_hpet(void) this_offset = ((unsigned long long )last_tsc_high<<32 )|last_tsc_low; monotonic_base +=cycles_2_ns (this_offset - last_offset);write_sequnlock (&monotonic_lock); + +return 1 ; }static void delay_hpet (unsigned long loops)
arch/i386/kernel/timers/timer_none.c +2 -1
@@ -1,9 +1,10 @@#include <linux/init.h> #include <asm/timer.h> -static void mark_offset_none (void ) +static int mark_offset_none (void ) {/* nothing needed */ +return 1 ; }static unsigned long get_offset_none (void )
It may be a little hard to see my comments as i've re-attached the patch inline as i couldn't reply-to properly (it was an attachment).
@@ -932,6 +933,9 @@ void (*wait_timer_tick)(void) __devinitd
#define APIC_DIVISOR 16
+static u32 apic_timer_val;
__read_mostly ?
+void dyn_tick_interrupt(int irq, struct pt_regs *regs) +{
+ int all_were_sleeping = 0;
+ int cpu = smp_processor_id();
+
+ if (!cpu_isset(cpu, nohz_cpu_mask))
+ return;
+
+ spin_lock(dyn_tick_lock);
This is going to cause contention problems for things like smp_call_function since all processors will be calling back to dyn_tick_interrupt.
+ if (cpus_equal(nohz_cpu_mask, cpu_online_map))
+ all_were_sleeping = 1;
+ cpu_clear(cpu, nohz_cpu_mask);
+
+ if (all_were_sleeping) {
+ /* Recover jiffies */
+ if (irq) {
Perhaps simply call the 'irq' parameter as in_irq as right now it seems to mean anything between irq or vector and somewhat confusing.
@@ -1190,15 +1191,19 @@ static inline void ioapic_register_intr(
if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
trigger == IOAPIC_LEVEL)
irq_desc[vector].handler = &ioapic_level_type;
- else
+ else if (vector)
irq_desc[vector].handler = &ioapic_edge_type;
+ else
+ irq_desc[vector].handler = IOAPIC_EDGE_TYPE_IRQ0;
Please at least be explicit and not hide things behind #defines
if (vector == 0)
irq_desc[vector].handler = &ioapic_edge_type_irq0
DEFINE_PER_CPU(irq_cpustat_t, irq_stat) ____cacheline_maxaligned_in_smp; EXPORT_PER_CPU_SYMBOL(irq_stat);
@@ -76,6 +77,8 @@ fastcall unsigned int do_IRQ(struct pt_r
}
#endif
+ dyn_tick_interrupt(irq, regs);
This looks like it might contribute quite some contention in the irq fast path.
Thanks,
Zwane
Quoted 2 lines · Zwane Mwaikambo
It may be a little hard to see my comments as i've re-attached the patch inline as i couldn't reply-to properly (it was an attachment).
My bad sorry I'm addicted to a graphical MUA. The best I can do is inline the attachment. I could probably cut and paste but I'm afraid of mangling the patch.
Quoted 7 lines
arch/i386/kernel/apic.c +1
-0@@ -932,6 +933,9 @@ void (*wait_timer_tick)(void) __devinitd#define APIC_DIVISOR 16 +static u32 apic_timer_val;
__read_mostly?
Yeah I like that idea.
Quoted 10 lines
arch/i386/kernel/dyn-tick.c new file +9
-0+void dyn_tick_interrupt (int irq,struct pt_regs *regs) +{ +int all_were_sleeping =0 ; +int cpu =smp_processor_id (); + +if (!cpu_isset (cpu, nohz_cpu_mask)) +return ; + +spin_lock (dyn_tick_lock);
Quoted 3 lines
This is going to cause contention problems for things like
smp_call_functionsince all processors will be calling back todyn_tick_interrupt.
Hmm got any ideas?
Quoted 10 lines
arch/i386/kernel/dyn-tick.c new file +7
-0+if (cpus_equal (nohz_cpu_mask, cpu_online_map)) + all_were_sleeping =1 ; +cpu_clear (cpu, nohz_cpu_mask); + +if (all_were_sleeping) { +/* Recover jiffies */ +if (irq) {Perhaps simply call the 'irq' parameter as
in_irqas right now it seems to mean anything between irq or vector and somewhat confusing.
Do you mean not pass the irq variables and just check for if (in_irq()) ?
Quoted 12 lines
arch/i386/kernel/io_apic.c +3
-1@@ -1190,15 +1191,19 @@ static inline void ioapic_register_intr(if ((trigger ==IOAPIC_AUTO &&IO_APIC_irq_trigger (irq)) || trigger ==IOAPIC_LEVEL ) irq_desc[vector].handler = &ioapic_level_type; -else +else if (vector) irq_desc[vector].handler = &ioapic_edge_type; +else + irq_desc[vector].handler =IOAPIC_EDGE_TYPE_IRQ0 ;Please at least be explicit and not hide things behind #defines
Quoted 2 lines
if (vector == 0)
irq_desc[vector].handler =&ioapic_edge_type_irq0
Well ioapic_edge_type_irq0 doesn't exist on !CONFIG_NO_IDLE_HZ and this was a way of avoiding ifdefs in this .c file. I'll think about it again.
Quoted 10 lines
DEFINE_PER_CPU(irq_cpustat_t, irq_stat)____cacheline_maxaligned_in_smp;EXPORT_PER_CPU_SYMBOL(irq_stat);arch/i386/kernel/irq.c +1
-0@@ -76,6 +77,8 @@ fastcall unsigned int do_IRQ(struct pt_r }#endif +dyn_tick_interrupt (irq, regs);This looks like it might contribute quite some contention in the irq fast path.
Might or is certain to? I don't really have hardware to test this hypothesis (nor do I know how) so I'd like to know how likely you think it is, and if there is some obvious way to improve this?
Thanks very much for your comments!
Cheers,
Con
Quoted 7 lines · Con Kolivas
So far this version seems to boot and run fine, but there are at least 2 places in the kernel that need to be made aware of the fact they're running dynticks; the ondemand scaling governor and the bus mastering code (as pointed out by Tytso). Both don't realise the few ticks that have passed are quite some distance apart and overestimate the load grossly. They are not harmful, but lead to increase in power usage instead of a decrease. I have yet to investigate that code portion to see what needs to be done
After 2 days of uptime this patch did not show any instability nor time loss. The only other issue that showed up was that per-process load is also calculated incorrectly so I need to address that as well.
Quoted 3 lines
The current patch is a series of 3 patches and a rollup and the split-out patches are all available here:
http://ck.kolivas.org/patches/dyn-ticks/
And inlined again here again (unchanged) instead of attached.
Cheers,
Con
---
arch/i386/Kconfig +16 -0
@@ -173,6 +173,22 @@ config HPET_EMULATE_RTC depends on HPET_TIMER && RTC=y default y +config NO_IDLE_HZ + bool "Dynamic Tick Timer - Skip timer ticks during idle" + depends on EXPERIMENTAL + select X86_PM_TIMER + help + This option enables support for skipping timer ticks when the + processor is idle. During system load, timer is continuous. + This option saves power, as it allows the system to stay in + idle mode longer. Currently the only supported timer is ACPI PM + timer. TSC and HPET timers are not supported. + + Note that you can disable dynamic tick timer either by + passing dyntick=disable command line option, or via sysfs: + + # echo 0 > /sys/devices/system/dyn_tick/dyn_tick0/enable + config SMP bool "Symmetric multi-processing support" ---help---
arch/i386/defconfig +1 -0
@@ -91,6 +91,7 @@ CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y # CONFIG_HPET_TIMER is not set # CONFIG_HPET_EMULATE_RTC is not set +# CONFIG_NO_IDLE_HZ is not set CONFIG_SMP=y CONFIG_NR_CPUS=8 CONFIG_SCHED_SMT=y
arch/i386/kernel/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-$(CONFIG_MODULES) += module.o obj-y += sysenter.o vsyscall.o obj-$(CONFIG_ACPI_SRAT) += srat.o obj-$(CONFIG_HPET_TIMER) += time_hpet.o +obj-$(CONFIG_NO_IDLE_HZ) += dyn-tick.o obj-$(CONFIG_EFI) += efi.o efi_stub.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/i386/kernel/apic.c +30 -1
@@ -26,6 +26,7 @@#include <linux/kernel_stat.h> #include <linux/sysdev.h> #include <linux/cpu.h> +#include <linux/dyn-tick.h> #include <asm/atomic.h> #include <asm/smp.h>
@@ -932,6 +933,9 @@ void (*wait_timer_tick)(void) __devinitd#define APIC_DIVISOR 16 +static u32 apic_timer_val; +#define APIC_TIMER_VAL ((apic_timer_val) / (HZ)) +static void __setup_APIC_LVTT (unsigned int clocks) {unsigned int lvtt_value, tmp_value, ver;
@@ -950,7 +954,9 @@ static void __setup_APIC_LVTT(unsigned i & ~(APIC_TDR_DIV_1 | APIC_TDR_DIV_TMBASE)) | APIC_TDR_DIV_16); -apic_write_around (APIC_TMICT , clocks/APIC_DIVISOR ); + apic_timer_val = clocks *HZ /APIC_DIVISOR ; + +apic_write_around (APIC_TMICT ,APIC_TIMER_VAL ); }static void __devinit setup_APIC_timer (unsigned int clocks)
@@ -969,6 +975,17 @@ static void __devinit setup_APIC_timer(ulocal_irq_restore (flags); } +/* Used by NO_IDLE_HZ to skip ticks on idle CPUs */ +void reprogram_apic_timer (unsigned long count) +{ +unsigned long flags; + + count = count * apic_timer_val /HZ ; +local_irq_save (flags); +apic_write_around (APIC_TMICT , count); +local_irq_restore (flags); +} +/* * In this function we calibrate APIC bus clocks to the external * timer. Unfortunately we cannot use jiffies and the timer irq
@@ -1064,6 +1081,9 @@ void __init setup_boot_APIC_clock(void)*/ setup_APIC_timer (calibration_result); +setup_dyn_tick_use_apic (calibration_result); +set_dyn_tick_max_skip ((0xFFFFFFFF / calibration_result) *APIC_DIVISOR ); +local_irq_restore (flags); }
@@ -1202,6 +1222,9 @@ fastcall void smp_apic_timer_interrupt(s* interrupt lock, which is the WrongThing (tm) to do. */ irq_enter (); + +dyn_tick_interrupt (LOCAL_TIMER_VECTOR , regs); +smp_local_timer_interrupt (regs);irq_exit (); }
@@ -1214,6 +1237,9 @@ fastcall void smp_spurious_interrupt(strunsigned long v;irq_enter (); + +dyn_tick_interrupt (SPURIOUS_APIC_VECTOR , regs); +/* * Check if this really is a spurious interrupt and ACK it * if it is a vectored one. Just in case...
@@ -1238,6 +1264,9 @@ fastcall void smp_error_interrupt(structunsigned long v, v1;irq_enter (); + +dyn_tick_interrupt (ERROR_APIC_VECTOR , regs); +/* First tickle the hardware, only then report what went on. -- REW */ v =apic_read (APIC_ESR );apic_write (APIC_ESR ,0 );
arch/i386/kernel/dyn-tick.c new file +154 -0
154 lines not on this page · raw message
arch/i386/kernel/io_apic.c +22 -3
@@ -32,6 +32,7 @@#include <linux/acpi.h> #include <linux/module.h> #include <linux/sysdev.h> +#include <linux/dyn-tick.h> #include <asm/io.h> #include <asm/smp.h>
@@ -1190,15 +1191,19 @@ static inline void ioapic_register_intr(if ((trigger ==IOAPIC_AUTO &&IO_APIC_irq_trigger (irq)) || trigger ==IOAPIC_LEVEL ) irq_desc[vector].handler = &ioapic_level_type; -else +else if (vector) irq_desc[vector].handler = &ioapic_edge_type; +else + irq_desc[vector].handler =IOAPIC_EDGE_TYPE_IRQ0 ;set_intr_gate (vector, interrupt[vector]); }else {if ((trigger ==IOAPIC_AUTO &&IO_APIC_irq_trigger (irq)) || trigger ==IOAPIC_LEVEL ) irq_desc[irq].handler = &ioapic_level_type; -else +else if (irq) irq_desc[irq].handler = &ioapic_edge_type; +else + irq_desc[irq].handler =IOAPIC_EDGE_TYPE_IRQ0 ;set_intr_gate (vector, interrupt[irq]); } }
@@ -1311,7 +1316,7 @@ static void __init setup_ExtINT_IRQ0_pin* The timer IRQ doesn't have to know that behind the * scene we have a 8259A-master in AEOI mode ... */ - irq_desc[0 ].handler = &ioapic_edge_type; + irq_desc[0 ].handler =IOAPIC_EDGE_TYPE_IRQ0 ;/* * Add it to the IO-APIC irq-routing table:
@@ -2088,6 +2093,20 @@ static struct hw_interrupt_type ioapic_l#endif }; +/* Needed to disable PIT interrupts when all CPUs sleep */ +struct hw_interrupt_type ioapic_edge_type_irq0 = { + .typename ="IO-APIC-edge-irq0" , + .startup = startup_edge_ioapic, + .shutdown = shutdown_edge_ioapic, + .enable = unmask_IO_APIC_irq, + .disable = mask_IO_APIC_irq, + .ack = ack_edge_ioapic, + .end = end_edge_ioapic, +#ifdef CONFIG_SMP + .set_affinity = set_ioapic_affinity, +#endif +}; +static inline void init_IO_APIC_traps (void ) {int irq;
arch/i386/kernel/irq.c +3 -0
@@ -18,6 +18,7 @@#include <linux/notifier.h> #include <linux/cpu.h> #include <linux/delay.h> +#include <linux/dyn-tick.h> DEFINE_PER_CPU(irq_cpustat_t, irq_stat) ____cacheline_maxaligned_in_smp;EXPORT_PER_CPU_SYMBOL (irq_stat);
@@ -76,6 +77,8 @@ fastcall unsigned int do_IRQ(struct pt_r }#endif +dyn_tick_interrupt (irq, regs); +#ifdef CONFIG_4KSTACKS curctx = (union irq_ctx *)current_thread_info ();
arch/i386/kernel/process.c +3 -0
@@ -39,6 +39,7 @@#include <linux/ptrace.h> #include <linux/random.h> #include <linux/kprobes.h> +#include <linux/dyn-tick.h> #include <asm/uaccess.h> #include <asm/pgtable.h>
@@ -193,6 +194,8 @@ void cpu_idle(void)if (cpu_is_offline (cpu))play_dead (); +idle_reprogram_timer (); +__get_cpu_var (irq_stat).idle_timestamp = jiffies;idle (); }
arch/i386/kernel/smp.c +8 -0
@@ -20,6 +20,7 @@#include <linux/interrupt.h> #include <linux/cpu.h> #include <linux/module.h> +#include <linux/dyn-tick.h> #include <asm/mtrr.h> #include <asm/tlbflush.h>
@@ -313,6 +314,8 @@ fastcall void smp_invalidate_interrupt(s {unsigned long cpu; +dyn_tick_interrupt (INVALIDATE_TLB_VECTOR , regs); + cpu =get_cpu ();if (!cpu_isset (cpu, flush_cpumask))
@@ -600,6 +603,8 @@ void smp_send_stop(void) fastcall void smp_reschedule_interrupt(struct pt_regs *regs) {ack_APIC_irq (); + +dyn_tick_interrupt (RESCHEDULE_VECTOR , regs); } fastcall void smp_call_function_interrupt(struct pt_regs *regs)
@@ -609,6 +614,9 @@ fastcall void smp_call_function_interrupint wait = call_data->wait;ack_APIC_irq (); + +dyn_tick_interrupt (CALL_FUNCTION_VECTOR , regs); +/* * Notify initiating CPU that I've grabbed the data and am * about to execute the function
arch/i386/kernel/time.c +12 -6
@@ -46,6 +46,7 @@#include <linux/bcd.h> #include <linux/efi.h> #include <linux/mca.h> +#include <linux/dyn-tick.h> #include <asm/io.h> #include <asm/smp.h>
@@ -245,7 +246,7 @@ EXPORT_SYMBOL(profile_pc);* timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -static inline void do_timer_interrupt (int irq,struct pt_regs *regs) +static inline void do_timer_interrupt (int irq,struct pt_regs *regs,int lost) {#ifdef CONFIG_X86_IO_APIC if (timer_ack) {
@@ -263,7 +264,8 @@ static inline void do_timer_interrupt(in }#endif -do_timer_interrupt_hook (regs); +if (!dyn_tick_enabled () || lost) +do_timer_interrupt_hook (regs);if (MCA_bus) {
@@ -288,6 +290,8 @@ static inline void do_timer_interrupt(in*/ irqreturn_t timer_interrupt (int irq,void *dev_id,struct pt_regs *regs) { +int lost; +/* * Here we are in the timer irq handler. We just have irqs locally * disabled but we don't know if the timer_bh is running on the other
@@ -297,9 +301,9 @@ irqreturn_t timer_interrupt(int irq, voi*/ write_seqlock (&xtime_lock); - cur_timer->mark_offset (); - -do_timer_interrupt (irq, regs); + lost = cur_timer->mark_offset (); + +do_timer_interrupt (irq, regs, lost);write_sequnlock (&xtime_lock);return IRQ_HANDLED ;
@@ -425,7 +429,7 @@ static struct sysdev_class timer_sysclas/* XXX this driverfs stuff should probably go elsewhere later -john */ -static struct sys_device device_timer = { +struct sys_device device_timer = { .id =0 , .cls = &timer_sysclass, };
@@ -481,5 +485,7 @@ void __init time_init(void) cur_timer =select_timer ();printk (KERN_INFO "Using %s for high-res timesource\n" ,cur_timer->name); +dyn_tick_time_init (cur_timer); +time_init_hook (); }
arch/i386/kernel/timers/timer_pit.c +34 -1
@@ -31,9 +31,10 @@ static int __init init_pit(char* overridreturn 0 ; } -static void mark_offset_pit (void ) +static int mark_offset_pit (void ) {/* nothing needed */ +return 1 ; }static unsigned long long monotonic_clock_pit (void )
@@ -147,6 +148,38 @@ static unsigned long get_offset_pit(voidreturn count; } +void disable_pit_timer (void ) +{ + irq_desc[0 ].handler->disable (0 ); +} + +void enable_pit_timer (void ) +{ + irq_desc[0 ].handler->enable (0 ); +} + +/* +* Reprograms the next timer interrupt +* PIT timer reprogramming code taken from APM code. +* Note that PIT timer is a 16-bit timer, which allows max +* skip of only few seconds. +*/ +void reprogram_pit_timer (unsigned long jiffies_to_skip) +{ +int skip; +extern spinlock_t i8253_lock; +unsigned long flags; + + skip = jiffies_to_skip *LATCH ; +if (skip >0xffff ) + skip =0xffff ; + +spin_lock_irqsave (&i8253_lock, flags); +outb_p (0x34 ,PIT_MODE );/* binary, mode 2, LSB/MSB, ch 0 */ +outb_p (skip &0xff ,PIT_CH0 );/* LSB */ +outb (skip >>8 ,PIT_CH0 );/* MSB */ +spin_unlock_irqrestore (&i8253_lock, flags); +}/* tsc timer_opts struct */ struct timer_opts timer_pit = {
arch/i386/kernel/timers/timer_pm.c +15 -17
@@ -15,6 +15,7 @@#include <linux/module.h> #include <linux/device.h> #include <linux/init.h> +#include <linux/dyn-tick.h> #include <asm/types.h> #include <asm/timer.h> #include <asm/smp.h>
@@ -28,7 +29,7 @@#define PMTMR_TICKS_PER_SEC 3579545#define PMTMR_EXPECTED_RATE \ ((CALIBRATE_LATCH * (PMTMR_TICKS_PER_SEC >> 10)) / (CLOCK_TICK_RATE>>10)) - +#define PMTMR_TICKS_PER_JIFFY (PMTMR_EXPECTED_RATE / (CALIBRATE_LATCH/LATCH))/* The I/O port the PMTMR resides at. * The location is detected during setup_arch(),
@@ -127,7 +128,13 @@ pm_good:if (verify_pmtmr_rate () !=0 )return -ENODEV ; +printk ("Using %u PM timer ticks per jiffy \n" ,PMTMR_TICKS_PER_JIFFY ); + + offset_tick =read_pmtmr (); +setup_pit_timer (); +init_cpu_khz (); +set_dyn_tick_max_skip (((0xFFFFFF /1000000 ) *286 *HZ ) >>10 );return 0 ; }
@@ -148,10 +155,9 @@ static inline u32 cyc2us(u32 cycles)* this gets called during each timer interrupt * - Called while holding the writer xtime_lock */ -static void mark_offset_pmtmr (void ) +static int mark_offset_pmtmr (void ) {u32 lost, delta, last_offset; -static int first_run =1 ; last_offset = offset_tick;write_seqlock (&monotonic_lock);
@@ -161,29 +167,20 @@ static void mark_offset_pmtmr(void)/* calculate tick interval */ delta = (offset_tick - last_offset) &ACPI_PM_MASK ; -/* convert to usecs */ - delta =cyc2us (delta); -/* update the monotonic base value */ - monotonic_base += delta *NSEC_PER_USEC ; + monotonic_base +=cyc2us (delta) *NSEC_PER_USEC ;write_sequnlock (&monotonic_lock);/* convert to ticks */ delta += offset_delay; - lost = delta / (USEC_PER_SEC /HZ ); - offset_delay = delta % (USEC_PER_SEC /HZ ); - + lost = delta /PMTMR_TICKS_PER_JIFFY ; + offset_delay = delta %PMTMR_TICKS_PER_JIFFY ;/* compensate for lost ticks */ if (lost >=2 ) jiffies_64 += lost -1 ; -/* don't calculate delay for first run, -or if we've got less then a tick */ -if (first_run || (lost <1 )) { - first_run =0 ; - offset_delay =0 ; - } +return lost; }static int pmtmr_resume (void )
@@ -192,6 +189,7 @@ static int pmtmr_resume(void)/* Assume this is the last mark offset time */ offset_tick =read_pmtmr ();write_sequnlock (&monotonic_lock); + offset_delay =0 ;return 0 ; }
@@ -243,7 +241,7 @@ static unsigned long get_offset_pmtmr(vo now =read_pmtmr (); delta = (now - offset)&ACPI_PM_MASK ; -return (unsigned long ) offset_delay +cyc2us (delta); +return (unsigned long )cyc2us (delta + offset_delay); }
arch/i386/kernel/timers/timer_tsc.c +30 -31
138 lines not on this page · raw message
drivers/acpi/Kconfig +2 -0
@@ -302,6 +302,8 @@ config X86_PM_TIMER voltage scaling, unlike the commonly used Time Stamp Counter (TSC) timing source. + This timer is selected by dyntick (NO_IDLE_HZ). + So, if you see messages like 'Losing too many ticks!' in the kernel logs, and/or you are using this on a notebook which does not yet have an HPET, you should say "Y" here.
include/asm-i386/apic.h +2 -0
@@ -121,6 +121,7 @@ extern void nmi_watchdog_tick (struct ptextern int APIC_init_uniprocessor (void );extern void disable_APIC_timer (void );extern void enable_APIC_timer (void ); +extern void reprogram_apic_timer (unsigned long count);extern void enable_NMI_through_LVT0 (void * dummy);
@@ -134,6 +135,7 @@ extern int disable_timer_pin_1;#else /* !CONFIG_X86_LOCAL_APIC */ static inline void lapic_shutdown (void ) { } +static inline void reprogram_apic_timer (unsigned long count) { }#endif /* !CONFIG_X86_LOCAL_APIC */
include/asm-i386/dyn-tick.h new file +96 -0
96 lines not on this page · raw message
include/asm-i386/timer.h +4 -1
@@ -19,7 +19,7 @@*/ struct timer_opts {char * name; -void (*mark_offset)(void ); +int (*mark_offset)(void );unsigned long (*get_offset)(void );unsigned long long (*monotonic_clock)(void );void (*delay)(unsigned long );
@@ -38,6 +38,9 @@ struct init_timer_opts {extern struct timer_opts *__init select_timer (void );extern void clock_fallback (void );void setup_pit_timer (void ); +extern void disable_pit_timer (void ); +extern void enable_pit_timer (void ); +extern void reprogram_pit_timer (unsigned long jiffies_to_skip);/* Modifiers for buggy PIT handling */
include/linux/dyn-tick.h new file +64 -0
64 lines not on this page · raw message
include/linux/timer.h +1 -0
@@ -97,5 +97,6 @@ static inline void add_timer(struct timeextern void init_timers (void );extern void run_local_timers (void );extern void it_real_fn (unsigned long ); +extern void conditional_run_local_timers (void );#endif
kernel/dyn-tick.c new file +190 -0
190 lines not on this page · raw message
kernel/timer.c +7 -0
@@ -869,6 +869,13 @@ void run_local_timers(void)raise_softirq (TIMER_SOFTIRQ ); } +void conditional_run_local_timers (void ) +{ +tvec_base_t *base = &__get_cpu_var (tvec_bases); + +if (base->timer_jiffies != jiffies) +run_local_timers (); +}/* * Called by the timer interrupt. xtime_lock must already be taken * by the timer IRQ!
kernel/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ obj-$(CONFIG_CRASH_DUMP) += crash_dump.o obj-$(CONFIG_SECCOMP) += seccomp.o obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o +obj-$(CONFIG_NO_IDLE_HZ) += dyn-tick.o ifneq ($(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER),y) # According to Alan Modra <[email protected]>, the -fno-omit-frame-pointer is
arch/i386/kernel/timers/timer_cyclone.c +3 -1
@@ -45,7 +45,7 @@ static seqlock_t monotonic_lock = SEQLOC }while (high != cyclone_timer[1 ]); -static void mark_offset_cyclone (void ) +static int mark_offset_cyclone (void ) {unsigned long lost, delay;unsigned long delta = last_cyclone_low;
@@ -101,6 +101,8 @@ static void mark_offset_cyclone(void)*/ if (lost &&abs (delay - delay_at_last_interrupt) > (900000 /HZ )) jiffies_64++; + +return 1 ; }static unsigned long get_offset_cyclone (void )
arch/i386/kernel/timers/timer_hpet.c +3 -1
@@ -101,7 +101,7 @@ static unsigned long get_offset_hpet(voireturn edx; } -static void mark_offset_hpet (void ) +static int mark_offset_hpet (void ) {unsigned long long this_offset, last_offset;unsigned long offset;
@@ -124,6 +124,8 @@ static void mark_offset_hpet(void) this_offset = ((unsigned long long )last_tsc_high<<32 )|last_tsc_low; monotonic_base +=cycles_2_ns (this_offset - last_offset);write_sequnlock (&monotonic_lock); + +return 1 ; }static void delay_hpet (unsigned long loops)
arch/i386/kernel/timers/timer_none.c +2 -1
@@ -1,9 +1,10 @@#include <linux/init.h> #include <asm/timer.h> -static void mark_offset_none (void ) +static int mark_offset_none (void ) {/* nothing needed */ +return 1 ; }static unsigned long get_offset_none (void )