diff -NurpP --minimal linux-2.6.9/arch/i386/Kconfig linux-2.6.9-hihz/arch/i386/Kconfig --- linux-2.6.9/arch/i386/Kconfig 2004-10-23 05:05:57.000000000 +0200 +++ linux-2.6.9-hihz/arch/i386/Kconfig 2004-11-06 20:02:11.000000000 +0100 @@ -547,6 +547,14 @@ config X86_IO_APIC depends on !SMP && X86_UP_IOAPIC default y +config KERNEL_HZ + int "Timer Frequency (100-20000)" + range 100 20000 + default "1000" + help + This allows you to specify the frequency at which the + kernel timer interrupt will occur. + config X86_TSC bool depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2) && !X86_NUMAQ diff -NurpP --minimal linux-2.6.9/arch/i386/kernel/cpu/proc.c linux-2.6.9-hihz/arch/i386/kernel/cpu/proc.c --- linux-2.6.9/arch/i386/kernel/cpu/proc.c 2004-10-23 05:05:58.000000000 +0200 +++ linux-2.6.9-hihz/arch/i386/kernel/cpu/proc.c 2004-11-06 07:09:28.000000000 +0100 @@ -121,8 +121,8 @@ static int show_cpuinfo(struct seq_file seq_printf(m, " %s", x86_cap_flags[i]); seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n", - c->loops_per_jiffy/(500000/HZ), - (c->loops_per_jiffy/(5000/HZ)) % 100); + HZ*(c->loops_per_jiffy >> 3)/62500, + (HZ*(c->loops_per_jiffy >> 3)/625) % 100); return 0; } diff -NurpP --minimal linux-2.6.9/arch/i386/kernel/smpboot.c linux-2.6.9-hihz/arch/i386/kernel/smpboot.c --- linux-2.6.9/arch/i386/kernel/smpboot.c 2004-10-23 05:05:58.000000000 +0200 +++ linux-2.6.9-hihz/arch/i386/kernel/smpboot.c 2004-11-06 06:57:36.000000000 +0100 @@ -1024,8 +1024,8 @@ static void __init smp_boot_cpus(unsigne printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", cpucount+1, - bogosum/(500000/HZ), - (bogosum/(5000/HZ))%100); + HZ*(bogosum >> 3)/62500, + (HZ*(bogosum >> 3)/625) % 100); Dprintk("Before bogocount - setting activated=1.\n"); diff -NurpP --minimal linux-2.6.9/drivers/acpi/osl.c linux-2.6.9-hihz/drivers/acpi/osl.c --- linux-2.6.9/drivers/acpi/osl.c 2004-10-23 05:06:03.000000000 +0200 +++ linux-2.6.9-hihz/drivers/acpi/osl.c 2004-11-06 07:11:35.000000000 +0100 @@ -897,7 +897,7 @@ acpi_os_wait_semaphore( // TODO: A better timeout algorithm? { int i = 0; - static const int quantum_ms = 1000/HZ; + static const int quantum_ms = (HZ>1000)?1:(1000/HZ); ret = down_trylock(sem); for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) { diff -NurpP --minimal linux-2.6.9/drivers/block/floppy.c linux-2.6.9-hihz/drivers/block/floppy.c --- linux-2.6.9/drivers/block/floppy.c 2004-08-14 12:54:50.000000000 +0200 +++ linux-2.6.9-hihz/drivers/block/floppy.c 2004-11-06 18:01:39.000000000 +0100 @@ -359,7 +359,11 @@ static int inr; /* size of reply buffe #define R_SECTOR (reply_buffer[5]) #define R_SIZECODE (reply_buffer[6]) +#if HZ < 12800 #define SEL_DLY (2*HZ/100) +#else +#define SEL_DLY (255) +#endif /* * this struct defines the different floppy drive types. @@ -4089,7 +4093,7 @@ static void __init daring(int *ints, int FD_SILENT_DCL_CLEAR; } else { default_drive_params[i].params.select_delay = - 2 * HZ / 100; + SEL_DLY; default_drive_params[i].params.flags &= ~FD_SILENT_DCL_CLEAR; } diff -NurpP --minimal linux-2.6.9/drivers/char/dtlk.c linux-2.6.9-hihz/drivers/char/dtlk.c --- linux-2.6.9/drivers/char/dtlk.c 2004-08-14 12:55:19.000000000 +0200 +++ linux-2.6.9-hihz/drivers/char/dtlk.c 2004-11-06 07:15:45.000000000 +0100 @@ -199,7 +199,7 @@ static ssize_t dtlk_write(struct file *f up to 250 usec for the RDY bit to go nonzero. */ for (retries = 0; - retries < loops_per_jiffy / (4000/HZ); + retries < HZ*(loops_per_jiffy >> 3)/500; retries++) if (inb_p(dtlk_port_tts) & TTS_WRITABLE) @@ -454,7 +454,7 @@ for (i = 0; i < 10; i++) \ LOOK dtlk_write_bytes("\0012I\r", 4); buffer[b++] = 0; - __delay(50 * loops_per_jiffy / (1000/HZ)); + __delay(50 * (loops_per_jiffy >> 3) * HZ / 125); outb_p(0xff, dtlk_port_lpc); buffer[b++] = 0; LOOK diff -NurpP --minimal linux-2.6.9/drivers/char/pcmcia/synclink_cs.c linux-2.6.9-hihz/drivers/char/pcmcia/synclink_cs.c --- linux-2.6.9/drivers/char/pcmcia/synclink_cs.c 2004-10-23 05:06:05.000000000 +0200 +++ linux-2.6.9-hihz/drivers/char/pcmcia/synclink_cs.c 2004-11-06 18:11:23.000000000 +0100 @@ -571,7 +571,11 @@ static dev_link_t *mgslpc_attach(void) INIT_WORK(&info->task, bh_handler, info); info->max_frame_size = 4096; info->close_delay = 5*HZ/10; + #if HZ < 2185 info->closing_wait = 30*HZ; + #else + info->closing_wait = 65534; + #endif init_waitqueue_head(&info->open_wait); init_waitqueue_head(&info->close_wait); init_waitqueue_head(&info->status_event_wait_q); diff -NurpP --minimal linux-2.6.9/drivers/char/synclink.c linux-2.6.9-hihz/drivers/char/synclink.c --- linux-2.6.9/drivers/char/synclink.c 2004-10-23 05:06:05.000000000 +0200 +++ linux-2.6.9-hihz/drivers/char/synclink.c 2004-11-06 18:06:41.000000000 +0100 @@ -4438,7 +4438,11 @@ struct mgsl_struct* mgsl_allocate_device INIT_WORK(&info->task, mgsl_bh_handler, info); info->max_frame_size = 4096; info->close_delay = 5*HZ/10; + #if HZ < 2185 info->closing_wait = 30*HZ; + #else + info->closing_wait = 65534; + #endif init_waitqueue_head(&info->open_wait); init_waitqueue_head(&info->close_wait); init_waitqueue_head(&info->status_event_wait_q); diff -NurpP --minimal linux-2.6.9/drivers/char/synclinkmp.c linux-2.6.9-hihz/drivers/char/synclinkmp.c --- linux-2.6.9/drivers/char/synclinkmp.c 2004-10-23 05:06:05.000000000 +0200 +++ linux-2.6.9-hihz/drivers/char/synclinkmp.c 2004-11-06 18:07:37.000000000 +0100 @@ -3847,7 +3847,11 @@ SLMP_INFO *alloc_dev(int adapter_num, in INIT_WORK(&info->task, bh_handler, info); info->max_frame_size = 4096; info->close_delay = 5*HZ/10; + #if HZ < 2185 info->closing_wait = 30*HZ; + #else + info->closing_wait = 65534; + #endif init_waitqueue_head(&info->open_wait); init_waitqueue_head(&info->close_wait); init_waitqueue_head(&info->status_event_wait_q); diff -NurpP --minimal linux-2.6.9/drivers/usb/serial/io_edgeport.c linux-2.6.9-hihz/drivers/usb/serial/io_edgeport.c --- linux-2.6.9/drivers/usb/serial/io_edgeport.c 2004-10-23 05:06:14.000000000 +0200 +++ linux-2.6.9-hihz/drivers/usb/serial/io_edgeport.c 2004-11-06 18:48:51.000000000 +0100 @@ -1786,8 +1786,13 @@ static int get_serial_info(struct edgepo tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ; tmp.xmit_fifo_size = edge_port->maxTxCredits; tmp.baud_base = 9600; + #if HZ < 2185 tmp.close_delay = 5*HZ; tmp.closing_wait = 30*HZ; + #else + tmp.close_delay = 2*HZ; + tmp.closing_wait = 65534; + #endif // tmp.custom_divisor = state->custom_divisor; // tmp.hub6 = state->hub6; // tmp.io_type = state->io_type; diff -NurpP --minimal linux-2.6.9/drivers/usb/serial/io_ti.c linux-2.6.9-hihz/drivers/usb/serial/io_ti.c --- linux-2.6.9/drivers/usb/serial/io_ti.c 2004-10-23 05:06:14.000000000 +0200 +++ linux-2.6.9-hihz/drivers/usb/serial/io_ti.c 2004-11-06 18:39:57.000000000 +0100 @@ -2425,8 +2425,13 @@ static int get_serial_info (struct edgep tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ; tmp.xmit_fifo_size = edge_port->port->bulk_out_size; tmp.baud_base = 9600; + #if HZ < 2185 tmp.close_delay = 5*HZ; tmp.closing_wait = 30*HZ; + #else + tmp.close_delay = 2*HZ; + tmp.closing_wait = 65534; + #endif // tmp.custom_divisor = state->custom_divisor; // tmp.hub6 = state->hub6; // tmp.io_type = state->io_type; diff -NurpP --minimal linux-2.6.9/include/asm-i386/param.h linux-2.6.9-hihz/include/asm-i386/param.h --- linux-2.6.9/include/asm-i386/param.h 2004-08-14 12:54:51.000000000 +0200 +++ linux-2.6.9-hihz/include/asm-i386/param.h 2004-11-06 16:07:38.000000000 +0100 @@ -2,7 +2,11 @@ #define _ASMi386_PARAM_H #ifdef __KERNEL__ -# define HZ 1000 /* Internal kernel timer frequency */ +# ifdef CONFIG_KERNEL_HZ +# define HZ CONFIG_KERNEL_HZ +# else +# define HZ 1000 /* Internal kernel timer frequency */ +# endif # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ #endif diff -NurpP --minimal linux-2.6.9/include/linux/cyclades.h linux-2.6.9-hihz/include/linux/cyclades.h --- linux-2.6.9/include/linux/cyclades.h 2004-10-23 05:06:22.000000000 +0200 +++ linux-2.6.9-hihz/include/linux/cyclades.h 2004-11-06 18:05:04.000000000 +0100 @@ -624,7 +624,11 @@ struct cyclades_port { #define Cy_EVENT_DELTA_WAKEUP 6 #define Cy_EVENT_Z_RX_FULL 7 +#if HZ < 2185 #define CLOSING_WAIT_DELAY 30*HZ +#else +#define CLOSING_WAIT_DELAY 65534 +#endif #define CY_CLOSING_WAIT_NONE 65535 #define CY_CLOSING_WAIT_INF 0 diff -NurpP --minimal linux-2.6.9/include/linux/dtlk.h linux-2.6.9-hihz/include/linux/dtlk.h --- linux-2.6.9/include/linux/dtlk.h 2004-08-14 12:56:01.000000000 +0200 +++ linux-2.6.9-hihz/include/linux/dtlk.h 2004-11-06 18:09:26.000000000 +0100 @@ -27,7 +27,7 @@ #define DTLK_CLEAR 0x18 /* stops speech */ -#define DTLK_MAX_RETRIES (loops_per_jiffy/(10000/HZ)) +#define DTLK_MAX_RETRIES (HZ*(loops_per_jiffy >> 3)/1250) /* TTS Port Status Flags */ #define TTS_READABLE 0x80 /* mask for bit which is nonzero if a diff -NurpP --minimal linux-2.6.9/include/linux/timex.h linux-2.6.9-hihz/include/linux/timex.h --- linux-2.6.9/include/linux/timex.h 2004-10-23 05:06:23.000000000 +0200 +++ linux-2.6.9-hihz/include/linux/timex.h 2004-11-06 03:15:28.000000000 +0100 @@ -79,6 +79,14 @@ # define SHIFT_HZ 9 #elif HZ >= 768 && HZ < 1536 # define SHIFT_HZ 10 +#elif HZ >= 1536 && HZ < 3072 +# define SHIFT_HZ 11 +#elif HZ >= 3072 && HZ < 6144 +# define SHIFT_HZ 12 +#elif HZ >= 6144 && HZ < 12288 +# define SHIFT_HZ 13 +#elif HZ >= 12288 && HZ < 24576 +# define SHIFT_HZ 14 #else # error You lose. #endif diff -NurpP --minimal linux-2.6.9/include/net/lapb.h linux-2.6.9-hihz/include/net/lapb.h --- linux-2.6.9/include/net/lapb.h 2004-08-14 12:56:22.000000000 +0200 +++ linux-2.6.9-hihz/include/net/lapb.h 2004-11-06 18:26:18.000000000 +0100 @@ -57,7 +57,11 @@ enum { #define LAPB_DEFAULT_MODE (LAPB_STANDARD | LAPB_SLP | LAPB_DTE) #define LAPB_DEFAULT_WINDOW 7 /* Window=7 */ +#if HZ < 2185 #define LAPB_DEFAULT_T1 (5 * HZ) /* T1=5s */ +#else +#define LAPB_DEFAULT_T1 (65534) /* T1=max */ +#endif #define LAPB_DEFAULT_T2 (1 * HZ) /* T2=1s */ #define LAPB_DEFAULT_N2 20 /* N2=20 */ diff -NurpP --minimal linux-2.6.9/include/net/tcp.h linux-2.6.9-hihz/include/net/tcp.h --- linux-2.6.9/include/net/tcp.h 2004-10-23 05:06:24.000000000 +0200 +++ linux-2.6.9-hihz/include/net/tcp.h 2004-11-06 03:36:44.000000000 +0100 @@ -487,8 +487,8 @@ static __inline__ int tcp_sk_listen_hash so that we select tick to get range about 4 seconds. */ -#if HZ <= 16 || HZ > 4096 -# error Unsupported: HZ <= 16 or HZ > 4096 +#if HZ <= 16 || HZ > 32768 +# error Unsupported: HZ <= 16 or HZ > 32768 #elif HZ <= 32 # define TCP_TW_RECYCLE_TICK (5+2-TCP_TW_RECYCLE_SLOTS_LOG) #elif HZ <= 64 @@ -503,8 +503,14 @@ static __inline__ int tcp_sk_listen_hash # define TCP_TW_RECYCLE_TICK (10+2-TCP_TW_RECYCLE_SLOTS_LOG) #elif HZ <= 2048 # define TCP_TW_RECYCLE_TICK (11+2-TCP_TW_RECYCLE_SLOTS_LOG) -#else +#elif HZ <= 4096 # define TCP_TW_RECYCLE_TICK (12+2-TCP_TW_RECYCLE_SLOTS_LOG) +#elif HZ <= 8192 +# define TCP_TW_RECYCLE_TICK (13+2-TCP_TW_RECYCLE_SLOTS_LOG) +#elif HZ <= 16384 +# define TCP_TW_RECYCLE_TICK (14+2-TCP_TW_RECYCLE_SLOTS_LOG) +#else +# define TCP_TW_RECYCLE_TICK (15+2-TCP_TW_RECYCLE_SLOTS_LOG) #endif #define BICTCP_1_OVER_BETA 8 /* diff -NurpP --minimal linux-2.6.9/init/main.c linux-2.6.9-hihz/init/main.c --- linux-2.6.9/init/main.c 2004-10-23 05:06:24.000000000 +0200 +++ linux-2.6.9-hihz/init/main.c 2004-11-06 06:56:15.000000000 +0100 @@ -215,8 +215,8 @@ void __devinit calibrate_delay(void) loops_per_jiffy = preset_lpj; printk("Calibrating delay loop (skipped)... " "%lu.%02lu BogoMIPS preset\n", - loops_per_jiffy/(500000/HZ), - (loops_per_jiffy/(5000/HZ)) % 100); + HZ*(loops_per_jiffy >> 3)/62500, + (HZ*(loops_per_jiffy >> 3)/625) % 100); } else { loops_per_jiffy = (1<<12); @@ -253,8 +253,8 @@ void __devinit calibrate_delay(void) /* Round the value and print it */ printk("%lu.%02lu BogoMIPS (lpj=%lu)\n", - loops_per_jiffy/(500000/HZ), - (loops_per_jiffy/(5000/HZ)) % 100, + HZ*(loops_per_jiffy >> 3)/62500, + (HZ*(loops_per_jiffy >> 3)/625) % 100, loops_per_jiffy); } diff -NurpP --minimal linux-2.6.9/kernel/timer.c linux-2.6.9-hihz/kernel/timer.c --- linux-2.6.9/kernel/timer.c 2004-10-23 05:06:24.000000000 +0200 +++ linux-2.6.9-hihz/kernel/timer.c 2004-11-06 07:03:08.000000000 +0100 @@ -675,7 +675,11 @@ static void second_overflow(void) if (ltemp > (MAXPHASE / MINSEC) << SHIFT_UPDATE) ltemp = (MAXPHASE / MINSEC) << SHIFT_UPDATE; time_offset += ltemp; + #if SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE > 0 time_adj = -ltemp << (SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE); + #else + time_adj = -ltemp >> (SHIFT_HZ + SHIFT_UPDATE - SHIFT_SCALE); + #endif } else { ltemp = time_offset; if (!(time_status & STA_FLL)) @@ -683,7 +687,11 @@ static void second_overflow(void) if (ltemp > (MAXPHASE / MINSEC) << SHIFT_UPDATE) ltemp = (MAXPHASE / MINSEC) << SHIFT_UPDATE; time_offset -= ltemp; + #if SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE > 0 time_adj = ltemp << (SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE); + #else + time_adj = ltemp >> (SHIFT_HZ + SHIFT_UPDATE - SHIFT_SCALE); + #endif } /* diff -NurpP --minimal linux-2.6.9/net/ipv4/netfilter/ip_conntrack_proto_sctp.c linux-2.6.9-hihz/net/ipv4/netfilter/ip_conntrack_proto_sctp.c --- linux-2.6.9/net/ipv4/netfilter/ip_conntrack_proto_sctp.c 2004-10-23 05:06:26.000000000 +0200 +++ linux-2.6.9-hihz/net/ipv4/netfilter/ip_conntrack_proto_sctp.c 2004-11-06 18:29:59.000000000 +0100 @@ -61,7 +61,11 @@ static const char *sctp_conntrack_names[ unsigned long ip_ct_sctp_timeout_closed = 10 SECS; unsigned long ip_ct_sctp_timeout_cookie_wait = 3 SECS; unsigned long ip_ct_sctp_timeout_cookie_echoed = 3 SECS; +#if HZ < 9942 unsigned long ip_ct_sctp_timeout_established = 5 DAYS; +#else +unsigned long ip_ct_sctp_timeout_established = 2 DAYS; +#endif unsigned long ip_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000; unsigned long ip_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; unsigned long ip_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; diff -NurpP --minimal linux-2.6.9/net/ipv4/netfilter/ip_conntrack_proto_tcp.c linux-2.6.9-hihz/net/ipv4/netfilter/ip_conntrack_proto_tcp.c --- linux-2.6.9/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2004-10-23 05:06:26.000000000 +0200 +++ linux-2.6.9-hihz/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2004-11-06 18:33:29.000000000 +0100 @@ -88,7 +88,11 @@ static const char *tcp_conntrack_names[] unsigned long ip_ct_tcp_timeout_syn_sent = 2 MINS; unsigned long ip_ct_tcp_timeout_syn_recv = 60 SECS; +#if HZ < 9942 unsigned long ip_ct_tcp_timeout_established = 5 DAYS; +#else +unsigned long ip_ct_tcp_timeout_established = 2 DAYS; +#endif unsigned long ip_ct_tcp_timeout_fin_wait = 2 MINS; unsigned long ip_ct_tcp_timeout_close_wait = 60 SECS; unsigned long ip_ct_tcp_timeout_last_ack = 30 SECS; diff -NurpP --minimal linux-2.6.9/net/irda/ircomm/ircomm_tty.c linux-2.6.9-hihz/net/irda/ircomm/ircomm_tty.c --- linux-2.6.9/net/irda/ircomm/ircomm_tty.c 2004-08-14 12:55:10.000000000 +0200 +++ linux-2.6.9-hihz/net/irda/ircomm/ircomm_tty.c 2004-11-06 18:27:13.000000000 +0100 @@ -393,7 +393,11 @@ static int ircomm_tty_open(struct tty_st self->max_header_size = IRCOMM_TTY_HDR_UNINITIALISED; self->max_data_size = IRCOMM_TTY_DATA_UNINITIALISED; self->close_delay = 5*HZ/10; + #if HZ < 2185 self->closing_wait = 30*HZ; + #else + self->closing_wait = 65534; + #endif /* Init some important stuff */ init_timer(&self->watchdog_timer);