diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/alpha/kernel/setup.c xx/arch/alpha/kernel/setup.c --- x-ref/arch/alpha/kernel/setup.c 2003-10-02 00:09:41.000000000 +0200 +++ xx/arch/alpha/kernel/setup.c 2003-10-02 15:15:49.000000000 +0200 @@ -520,6 +520,16 @@ setup_arch(char **cmdline_p) mem_size_limit = get_mem_size_limit(p+4); continue; } + if (strncmp(p, "HZ=", 3) == 0) { + unsigned long hz; + hz = get_mem_size_limit(p+3); + init_HZ(hz); + continue; + } + if (strncmp(p, "desktop", 7) == 0) { + init_desktop(); + continue; + } if (strncmp(p, "srmcons", 7) == 0) { srmcons_output |= 1; continue; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/i386/config.in xx/arch/i386/config.in --- x-ref/arch/i386/config.in 2003-10-02 15:15:46.000000000 +0200 +++ xx/arch/i386/config.in 2003-10-02 15:15:49.000000000 +0200 @@ -494,6 +494,7 @@ comment 'Kernel hacking' bool 'Kernel debugging' CONFIG_DEBUG_KERNEL if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then + bool ' Check for dynamic HZ initialization bugs' CONFIG_DEBUG_HZ bool ' Check for stack overflows' CONFIG_DEBUG_STACKOVERFLOW bool ' Debug high memory support' CONFIG_DEBUG_HIGHMEM bool ' Debug memory allocations' CONFIG_DEBUG_SLAB diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/i386/kernel/apm.c xx/arch/i386/kernel/apm.c --- x-ref/arch/i386/kernel/apm.c 2003-08-26 00:12:43.000000000 +0200 +++ xx/arch/i386/kernel/apm.c 2003-10-02 15:15:49.000000000 +0200 @@ -321,7 +321,7 @@ extern int (*console_blank_hook)(int); /* * Ignore suspend events for this amount of time after a resume */ -#define DEFAULT_BOUNCE_INTERVAL (3 * HZ) +#define DEFAULT_BOUNCE_INTERVAL (3 * USER_HZ) /* * Save a segment register away @@ -385,6 +385,7 @@ static int standbys_pending; static int ignore_sys_suspend; static int ignore_normal_resume; static int bounce_interval = DEFAULT_BOUNCE_INTERVAL; +#define bounce_interval_hz user_to_kernel_hz_overflow(bounce_interval) #ifdef CONFIG_APM_RTC_IS_GMT # define clock_cmos_diff 0 @@ -1317,7 +1318,7 @@ static void check_events(void) "event 0x%02x\n", event); } if (ignore_bounce - && ((jiffies - last_resume) > bounce_interval)) + && ((jiffies - last_resume) > bounce_interval_hz)) ignore_bounce = 0; switch (event) { @@ -2073,7 +2074,7 @@ MODULE_PARM(power_off, "i"); MODULE_PARM_DESC(power_off, "Enable power off"); MODULE_PARM(bounce_interval, "i"); MODULE_PARM_DESC(bounce_interval, - "Set the number of ticks to ignore suspend bounces"); + "Set the number of USER_HZ ticks to ignore suspend bounces"); MODULE_PARM(allow_ints, "i"); MODULE_PARM_DESC(allow_ints, "Allow interrupts during BIOS calls"); MODULE_PARM(broken_psr, "i"); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/i386/kernel/nmi.c xx/arch/i386/kernel/nmi.c --- x-ref/arch/i386/kernel/nmi.c 2003-10-02 15:15:43.000000000 +0200 +++ xx/arch/i386/kernel/nmi.c 2003-10-02 15:15:49.000000000 +0200 @@ -40,7 +40,8 @@ extern gdb_debug_hook * linux_debug_hook #endif unsigned int nmi_watchdog = NMI_NONE; -static unsigned int nmi_hz = HZ; +static unsigned int __nmi_hz = USER_HZ; +#define nmi_hz user_to_kernel_hz_overflow(__nmi_hz) unsigned int nmi_perfctr_msr; /* the MSR to reset in NMI handler */ extern void show_registers(struct pt_regs *regs); @@ -110,7 +111,7 @@ int __init check_nmi_watchdog (void) /* now that we know it works we can reduce NMI frequency to something more reasonable; makes a difference in some configs */ if (nmi_watchdog == NMI_LOCAL_APIC) - nmi_hz = 1; + __nmi_hz = 1; return 0; } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/i386/kernel/setup.c xx/arch/i386/kernel/setup.c --- x-ref/arch/i386/kernel/setup.c 2003-10-02 15:15:47.000000000 +0200 +++ xx/arch/i386/kernel/setup.c 2003-10-02 15:15:49.000000000 +0200 @@ -847,6 +847,13 @@ static void __init parse_cmdline_early ( else if (!memcmp(from, "noapic", 6)) disable_ioapic_setup(); #endif + + else if (!memcmp(from, "HZ=", 3)) { + unsigned long hz = memparse(from+3, &from); + init_HZ(hz); + } else if (!memcmp(from, "desktop", 7)) + init_desktop(); + /* * highmem=size forces highmem to be exactly 'size' bytes. * This works even on boxes that have no highmem otherwise. diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/i386/kernel/time.c xx/arch/i386/kernel/time.c --- x-ref/arch/i386/kernel/time.c 2003-10-02 15:15:46.000000000 +0200 +++ xx/arch/i386/kernel/time.c 2003-10-02 15:15:49.000000000 +0200 @@ -114,7 +114,7 @@ static inline unsigned long do_fast_gett return delay_at_last_interrupt + edx; } -#define TICK_SIZE tick +#define TICK_SIZE get_tick() spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED; @@ -161,7 +161,8 @@ static unsigned long do_slow_gettimeoffs int count; unsigned long flags; - static int count_p = LATCH; /* for the first call after boot */ + static int not_first_boot; + static int count_p; /* for the first call after boot */ static unsigned long jiffies_p = 0; /* @@ -171,6 +172,12 @@ static unsigned long do_slow_gettimeoffs /* gets recalled with irq locally disabled */ spin_lock_irqsave(&i8253_lock, flags); + + if (unlikely(!not_first_boot)) { + count_p = LATCH; + not_first_boot = 1; + } + /* timer count may underflow right here */ outb_p(0x00, 0x43); /* latch the count ASAP */ @@ -615,8 +622,8 @@ static inline void do_timer_interrupt(in */ if ((time_status & STA_UNSYNC) == 0 && xtime.tv_sec > last_rtc_update + 660 && - xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 && - xtime.tv_usec <= 500000 + ((unsigned) tick) / 2) { + xtime.tv_usec >= 500000 - ((unsigned) get_tick()) / 2 && + xtime.tv_usec <= 500000 + ((unsigned) get_tick()) / 2) { if (set_rtc_mmss(xtime.tv_sec) == 0) last_rtc_update = xtime.tv_sec; else diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/ia64/kernel/efi.c xx/arch/ia64/kernel/efi.c --- x-ref/arch/ia64/kernel/efi.c 2003-10-02 00:09:42.000000000 +0200 +++ xx/arch/ia64/kernel/efi.c 2003-10-02 15:15:49.000000000 +0200 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -481,6 +482,17 @@ efi_init (void) if (end != cp) break; cp = end; + } else if (memcmp(cp, "HZ=", 3) == 0) { + unsigned long hz; + cp += 3; + hz = memparse(cp, &end) - 1; + init_HZ(hz); + if (end != cp) + break; + cp = end; + } else if (memcmp(cp, "desktop", 7) == 0) { + cp += 7; + init_desktop(); } else { while (*cp != ' ' && *cp) ++cp; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/ppc/mm/init.c xx/arch/ppc/mm/init.c --- x-ref/arch/ppc/mm/init.c 2003-10-02 15:15:38.000000000 +0200 +++ xx/arch/ppc/mm/init.c 2003-10-02 15:15:49.000000000 +0200 @@ -312,6 +312,29 @@ void MMU_setup(void) } __max_memory = maxmem; } + + if (strstr(cmd_line, "HZ=")) { + char *p, *q; + unsigned long hz = 0; + + for (q = cmd_line; (p = strstr(q, "HZ=")) != 0; ) { + q = p + 3; + if (p > cmd_line && p[-1] != ' ') + continue; + hz = simple_strtoul(q, &q, 0); + if (*q == 'k' || *q == 'K') { + hz <<= 10; + ++q; + } else if (*q == 'm' || *q == 'M') { + hz <<= 20; + ++q; + } + } + init_HZ(hz); + } + + if (strstr(cmd_line, "desktop")) + init_desktop(); } /* diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/ppc64/kernel/ioctl32.c xx/arch/ppc64/kernel/ioctl32.c --- x-ref/arch/ppc64/kernel/ioctl32.c 2003-10-02 15:15:47.000000000 +0200 +++ xx/arch/ppc64/kernel/ioctl32.c 2003-10-02 15:15:49.000000000 +0200 @@ -1061,19 +1061,19 @@ static int fd_ioctl_trans(unsigned int f err |= __get_user(f->hlt, &((struct floppy_drive_params32 *)arg)->hlt); err |= __get_user(f->hut, &((struct floppy_drive_params32 *)arg)->hut); err |= __get_user(f->srt, &((struct floppy_drive_params32 *)arg)->srt); - err |= __get_user(f->spinup, &((struct floppy_drive_params32 *)arg)->spinup); - err |= __get_user(f->spindown, &((struct floppy_drive_params32 *)arg)->spindown); + err |= __get_user(f->__spinup, &((struct floppy_drive_params32 *)arg)->spinup); + err |= __get_user(f->__spindown, &((struct floppy_drive_params32 *)arg)->spindown); err |= __get_user(f->spindown_offset, &((struct floppy_drive_params32 *)arg)->spindown_offset); - err |= __get_user(f->select_delay, &((struct floppy_drive_params32 *)arg)->select_delay); + err |= __get_user(f->__select_delay, &((struct floppy_drive_params32 *)arg)->select_delay); err |= __get_user(f->rps, &((struct floppy_drive_params32 *)arg)->rps); err |= __get_user(f->tracks, &((struct floppy_drive_params32 *)arg)->tracks); - err |= __get_user(f->timeout, &((struct floppy_drive_params32 *)arg)->timeout); + err |= __get_user(f->__timeout, &((struct floppy_drive_params32 *)arg)->timeout); err |= __get_user(f->interleave_sect, &((struct floppy_drive_params32 *)arg)->interleave_sect); err |= __copy_from_user(&f->max_errors, &((struct floppy_drive_params32 *)arg)->max_errors, sizeof(f->max_errors)); err |= __get_user(f->flags, &((struct floppy_drive_params32 *)arg)->flags); err |= __get_user(f->read_track, &((struct floppy_drive_params32 *)arg)->read_track); err |= __copy_from_user(f->autodetect, ((struct floppy_drive_params32 *)arg)->autodetect, sizeof(f->autodetect)); - err |= __get_user(f->checkfreq, &((struct floppy_drive_params32 *)arg)->checkfreq); + err |= __get_user(f->__checkfreq, &((struct floppy_drive_params32 *)arg)->checkfreq); err |= __get_user(f->native_format, &((struct floppy_drive_params32 *)arg)->native_format); if (err) { err = -EFAULT; @@ -1131,19 +1131,19 @@ static int fd_ioctl_trans(unsigned int f err |= __put_user(f->hlt, &((struct floppy_drive_params32 *)arg)->hlt); err |= __put_user(f->hut, &((struct floppy_drive_params32 *)arg)->hut); err |= __put_user(f->srt, &((struct floppy_drive_params32 *)arg)->srt); - err |= __put_user(f->spinup, &((struct floppy_drive_params32 *)arg)->spinup); - err |= __put_user(f->spindown, &((struct floppy_drive_params32 *)arg)->spindown); + err |= __put_user(f->__spinup, &((struct floppy_drive_params32 *)arg)->spinup); + err |= __put_user(f->__spindown, &((struct floppy_drive_params32 *)arg)->spindown); err |= __put_user(f->spindown_offset, &((struct floppy_drive_params32 *)arg)->spindown_offset); - err |= __put_user(f->select_delay, &((struct floppy_drive_params32 *)arg)->select_delay); + err |= __put_user(f->__select_delay, &((struct floppy_drive_params32 *)arg)->select_delay); err |= __put_user(f->rps, &((struct floppy_drive_params32 *)arg)->rps); err |= __put_user(f->tracks, &((struct floppy_drive_params32 *)arg)->tracks); - err |= __put_user(f->timeout, &((struct floppy_drive_params32 *)arg)->timeout); + err |= __put_user(f->__timeout, &((struct floppy_drive_params32 *)arg)->timeout); err |= __put_user(f->interleave_sect, &((struct floppy_drive_params32 *)arg)->interleave_sect); err |= __copy_to_user(&((struct floppy_drive_params32 *)arg)->max_errors, &f->max_errors, sizeof(f->max_errors)); err |= __put_user(f->flags, &((struct floppy_drive_params32 *)arg)->flags); err |= __put_user(f->read_track, &((struct floppy_drive_params32 *)arg)->read_track); err |= __copy_to_user(((struct floppy_drive_params32 *)arg)->autodetect, f->autodetect, sizeof(f->autodetect)); - err |= __put_user(f->checkfreq, &((struct floppy_drive_params32 *)arg)->checkfreq); + err |= __put_user(f->__checkfreq, &((struct floppy_drive_params32 *)arg)->checkfreq); err |= __put_user(f->native_format, &((struct floppy_drive_params32 *)arg)->native_format); break; } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/ppc64/kernel/setup.c xx/arch/ppc64/kernel/setup.c --- x-ref/arch/ppc64/kernel/setup.c 2003-08-26 00:12:47.000000000 +0200 +++ xx/arch/ppc64/kernel/setup.c 2003-10-02 15:15:49.000000000 +0200 @@ -396,6 +396,30 @@ void parse_cmd_line(unsigned long r3, un } __max_memory = maxmem; } + + /* Look for mem= option on command line */ + if (strstr(cmd_line, "HZ=")) { + char *q; + unsigned long hz = 0; + + for (q = cmd_line; (p = strstr(q, "HZ=")) != 0; ) { + q = p + 3; + if (p > cmd_line && p[-1] != ' ') + continue; + hz = simple_strtoul(q, &q, 0); + if (*q == 'k' || *q == 'K') { + hz <<= 10; + ++q; + } else if (*q == 'm' || *q == 'M') { + hz <<= 20; + ++q; + } + } + init_HZ(hz); + } + + if (strstr(cmd_line, "desktop")) + init_desktop(); } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/ppc64/kernel/time.c xx/arch/ppc64/kernel/time.c --- x-ref/arch/ppc64/kernel/time.c 2003-10-02 15:15:46.000000000 +0200 +++ xx/arch/ppc64/kernel/time.c 2003-10-02 15:15:49.000000000 +0200 @@ -510,7 +510,7 @@ void __init time_init(void) xtime_sync_interval = tb_ticks_per_sec - (tb_ticks_per_sec/8); next_xtime_sync_tb = tb_last_stamp + xtime_sync_interval; - time_freq = 0; + __time_freq = 0; xtime.tv_usec = 0; last_rtc_update = xtime.tv_sec; @@ -528,7 +528,7 @@ void __init time_init(void) * to microseconds to keep do_gettimeofday synchronized * with ntpd. * - * Use the time_adjust, time_freq and time_offset computed by adjtimex to + * Use the time_adjust, __time_freq and time_offset computed by adjtimex to * adjust the frequency. */ @@ -545,7 +545,7 @@ void ppc_adjtimex(void) /* Compute parts per million frequency adjustment to accomplish the time adjustment implied by time_offset to be applied over the elapsed time indicated by time_constant. - Use SHIFT_USEC to get it into the same units as time_freq. */ + Use SHIFT_USEC to get it into the same units as __time_freq. */ if ( time_offset < 0 ) { ltemp = -time_offset; ltemp <<= SHIFT_USEC - SHIFT_UPDATE; @@ -577,7 +577,7 @@ void ppc_adjtimex(void) * large. 3/4 of tickadj*HZ seems about right */ singleshot_ppm -= singleshot_ppm / 4; - /* Use SHIFT_USEC to get it into the same units as time_freq */ + /* Use SHIFT_USEC to get it into the same units as __time_freq */ singleshot_ppm <<= SHIFT_USEC; if ( time_adjust < 0 ) singleshot_ppm = -singleshot_ppm; @@ -591,7 +591,7 @@ void ppc_adjtimex(void) } /* Add up all of the frequency adjustments */ - delta_freq = time_freq + ltemp + singleshot_ppm; + delta_freq = __time_freq + ltemp + singleshot_ppm; /* Compute a new value for tb_ticks_per_sec based on the frequency adjustment */ den = 1000000 * (1 << (SHIFT_USEC - 8)); @@ -605,7 +605,7 @@ void ppc_adjtimex(void) } #ifdef DEBUG_PPC_ADJTIMEX - printk("ppc_adjtimex: ltemp = %ld, time_freq = %ld, singleshot_ppm = %ld\n", ltemp, time_freq, singleshot_ppm); + printk("ppc_adjtimex: ltemp = %ld, __time_freq = %ld, singleshot_ppm = %ld\n", ltemp, __time_freq, singleshot_ppm); printk("ppc_adjtimex: tb_ticks_per_sec - base = %ld new = %ld\n", tb_ticks_per_sec, new_tb_ticks_per_sec); #endif diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/s390/kernel/setup.c xx/arch/s390/kernel/setup.c --- x-ref/arch/s390/kernel/setup.c 2003-08-26 00:12:47.000000000 +0200 +++ xx/arch/s390/kernel/setup.c 2003-10-02 15:15:49.000000000 +0200 @@ -463,6 +463,24 @@ void __init setup_arch(char **cmdline_p) saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; for (;;) { + /* + * HZ and desktop + */ + if (c == ' ' && strncmp(from, "HZ=", 3) == 0) { + unsigned long hz; + hz = simple_strtoul(from+3, &from, 0); + if ( *from == 'K' || *from == 'k' ) { + hz = hz << 10; + from++; + } else if ( *from == 'M' || *from == 'm' ) { + hz = hz << 20; + from++; + } + init_HZ(hz); + } + if (c == ' ' && strncmp(from, "desktop", 7) == 0) + init_desktop(); + /* * "mem=XXX[kKmM]" sets memsize */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/s390x/kernel/setup.c xx/arch/s390x/kernel/setup.c --- x-ref/arch/s390x/kernel/setup.c 2003-08-26 00:12:51.000000000 +0200 +++ xx/arch/s390x/kernel/setup.c 2003-10-02 15:15:49.000000000 +0200 @@ -336,6 +336,24 @@ void __init setup_arch(char **cmdline_p) saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; for (;;) { + /* + * HZ and desktop + */ + if (c == ' ' && strncmp(from, "HZ=", 3) == 0) { + unsigned long hz; + hz = simple_strtoul(from+3, &from, 0); + if ( *from == 'K' || *from == 'k' ) { + hz = hz << 10; + from++; + } else if ( *from == 'M' || *from == 'm' ) { + hz = hz << 20; + from++; + } + init_HZ(hz); + } + if (c == ' ' && strncmp(from, "desktop", 7) == 0) + init_desktop(); + /* * "mem=XXX[kKmM]" sets memsize */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/config.in xx/arch/x86_64/config.in --- x-ref/arch/x86_64/config.in 2003-10-02 15:15:47.000000000 +0200 +++ xx/arch/x86_64/config.in 2003-10-02 15:15:49.000000000 +0200 @@ -235,6 +235,7 @@ comment 'Kernel hacking' bool 'Kernel debugging' CONFIG_DEBUG_KERNEL if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then + bool ' Check for dynamic HZ initialization bugs' CONFIG_DEBUG_HZ bool ' Debug memory allocations' CONFIG_DEBUG_SLAB # bool ' Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/ia32/ia32_ioctl.c xx/arch/x86_64/ia32/ia32_ioctl.c --- x-ref/arch/x86_64/ia32/ia32_ioctl.c 2003-10-02 15:15:47.000000000 +0200 +++ xx/arch/x86_64/ia32/ia32_ioctl.c 2003-10-02 15:15:49.000000000 +0200 @@ -1059,19 +1059,19 @@ struct floppy_drive_params32 { u32 hlt; u32 hut; u32 srt; - u32 spinup; - u32 spindown; + u32 __spinup; + u32 __spindown; unsigned char spindown_offset; - unsigned char select_delay; + unsigned char __select_delay; unsigned char rps; unsigned char tracks; - u32 timeout; + u32 __timeout; unsigned char interleave_sect; struct floppy_max_errors max_errors; char flags; char read_track; short autodetect[8]; - int checkfreq; + int __checkfreq; int native_format; }; @@ -1203,19 +1203,19 @@ static int fd_ioctl_trans(unsigned int f err |= __get_user(f->hlt, &((struct floppy_drive_params32 *)arg)->hlt); err |= __get_user(f->hut, &((struct floppy_drive_params32 *)arg)->hut); err |= __get_user(f->srt, &((struct floppy_drive_params32 *)arg)->srt); - err |= __get_user(f->spinup, &((struct floppy_drive_params32 *)arg)->spinup); - err |= __get_user(f->spindown, &((struct floppy_drive_params32 *)arg)->spindown); + err |= __get_user(f->__spinup, &((struct floppy_drive_params32 *)arg)->__spinup); + err |= __get_user(f->__spindown, &((struct floppy_drive_params32 *)arg)->__spindown); err |= __get_user(f->spindown_offset, &((struct floppy_drive_params32 *)arg)->spindown_offset); - err |= __get_user(f->select_delay, &((struct floppy_drive_params32 *)arg)->select_delay); + err |= __get_user(f->__select_delay, &((struct floppy_drive_params32 *)arg)->__select_delay); err |= __get_user(f->rps, &((struct floppy_drive_params32 *)arg)->rps); err |= __get_user(f->tracks, &((struct floppy_drive_params32 *)arg)->tracks); - err |= __get_user(f->timeout, &((struct floppy_drive_params32 *)arg)->timeout); + err |= __get_user(f->__timeout, &((struct floppy_drive_params32 *)arg)->__timeout); err |= __get_user(f->interleave_sect, &((struct floppy_drive_params32 *)arg)->interleave_sect); err |= __copy_from_user(&f->max_errors, &((struct floppy_drive_params32 *)arg)->max_errors, sizeof(f->max_errors)); err |= __get_user(f->flags, &((struct floppy_drive_params32 *)arg)->flags); err |= __get_user(f->read_track, &((struct floppy_drive_params32 *)arg)->read_track); err |= __copy_from_user(f->autodetect, ((struct floppy_drive_params32 *)arg)->autodetect, sizeof(f->autodetect)); - err |= __get_user(f->checkfreq, &((struct floppy_drive_params32 *)arg)->checkfreq); + err |= __get_user(f->__checkfreq, &((struct floppy_drive_params32 *)arg)->__checkfreq); err |= __get_user(f->native_format, &((struct floppy_drive_params32 *)arg)->native_format); if (err) { err = -EFAULT; @@ -1273,19 +1273,19 @@ static int fd_ioctl_trans(unsigned int f err |= __put_user(f->hlt, &((struct floppy_drive_params32 *)arg)->hlt); err |= __put_user(f->hut, &((struct floppy_drive_params32 *)arg)->hut); err |= __put_user(f->srt, &((struct floppy_drive_params32 *)arg)->srt); - err |= __put_user(f->spinup, &((struct floppy_drive_params32 *)arg)->spinup); - err |= __put_user(f->spindown, &((struct floppy_drive_params32 *)arg)->spindown); + err |= __put_user(f->__spinup, &((struct floppy_drive_params32 *)arg)->__spinup); + err |= __put_user(f->__spindown, &((struct floppy_drive_params32 *)arg)->__spindown); err |= __put_user(f->spindown_offset, &((struct floppy_drive_params32 *)arg)->spindown_offset); - err |= __put_user(f->select_delay, &((struct floppy_drive_params32 *)arg)->select_delay); + err |= __put_user(f->__select_delay, &((struct floppy_drive_params32 *)arg)->__select_delay); err |= __put_user(f->rps, &((struct floppy_drive_params32 *)arg)->rps); err |= __put_user(f->tracks, &((struct floppy_drive_params32 *)arg)->tracks); - err |= __put_user(f->timeout, &((struct floppy_drive_params32 *)arg)->timeout); + err |= __put_user(f->__timeout, &((struct floppy_drive_params32 *)arg)->__timeout); err |= __put_user(f->interleave_sect, &((struct floppy_drive_params32 *)arg)->interleave_sect); err |= __copy_to_user(&((struct floppy_drive_params32 *)arg)->max_errors, &f->max_errors, sizeof(f->max_errors)); err |= __put_user(f->flags, &((struct floppy_drive_params32 *)arg)->flags); err |= __put_user(f->read_track, &((struct floppy_drive_params32 *)arg)->read_track); err |= __copy_to_user(((struct floppy_drive_params32 *)arg)->autodetect, f->autodetect, sizeof(f->autodetect)); - err |= __put_user(f->checkfreq, &((struct floppy_drive_params32 *)arg)->checkfreq); + err |= __put_user(f->__checkfreq, &((struct floppy_drive_params32 *)arg)->__checkfreq); err |= __put_user(f->native_format, &((struct floppy_drive_params32 *)arg)->native_format); break; } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/ia32/sys_ia32.c xx/arch/x86_64/ia32/sys_ia32.c --- x-ref/arch/x86_64/ia32/sys_ia32.c 2003-10-02 00:09:42.000000000 +0200 +++ xx/arch/x86_64/ia32/sys_ia32.c 2003-10-02 15:15:55.000000000 +0200 @@ -2978,12 +2978,6 @@ sys32_get_kernel_syms(struct kernel_sym long sys32_vm86_warning(void) { - static long warn_time = -(60*HZ); - if (time_before(warn_time + 60*HZ,jiffies)) { - printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n", - current->comm); - warn_time = jiffies; - } return -ENOSYS ; } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/kernel/bluesmoke.c xx/arch/x86_64/kernel/bluesmoke.c --- x-ref/arch/x86_64/kernel/bluesmoke.c 2003-10-02 00:09:42.000000000 +0200 +++ xx/arch/x86_64/kernel/bluesmoke.c 2003-10-02 15:15:49.000000000 +0200 @@ -301,7 +301,8 @@ static void k8_machine_check(struct pt_r } static struct timer_list mcheck_timer; -int mcheck_interval = 30*HZ; +int __mcheck_interval = 30*USER_HZ; +#define mcheck_interval user_to_kernel_hz_overflow(__mcheck_interval) #ifndef CONFIG_SMP static void mcheck_timer_handler(unsigned long data) @@ -463,7 +464,7 @@ static int __init mcheck_enable(char *st char *p; while ((p = strsep(&str,",")) != NULL) { if (isdigit(*p)) - mcheck_interval = simple_strtol(p,NULL,0) * HZ; + __mcheck_interval = simple_strtol(p,NULL,0) * USER_HZ; else if (!strcmp(p,"off")) mce_disabled = 1; else if (!strncmp(p,"enable",6)) diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/kernel/e820.c xx/arch/x86_64/kernel/e820.c --- x-ref/arch/x86_64/kernel/e820.c 2003-10-02 00:09:42.000000000 +0200 +++ xx/arch/x86_64/kernel/e820.c 2003-10-02 15:15:49.000000000 +0200 @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -557,6 +558,12 @@ void __init parse_mem_cmdline (char ** c skip_ioapic_setup = 0; } + else if (!memcmp(from, "HZ=", 3)) { + unsigned long hz = memparse(from+3, &from); + init_HZ(hz); + } else if (!memcmp(from, "desktop", 7)) + init_desktop(); + next: c = *(from++); if (!c) diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/kernel/irq.c xx/arch/x86_64/kernel/irq.c --- x-ref/arch/x86_64/kernel/irq.c 2003-10-02 15:15:32.000000000 +0200 +++ xx/arch/x86_64/kernel/irq.c 2003-10-02 15:15:49.000000000 +0200 @@ -57,7 +57,13 @@ static inline void stack_overflow_check(struct pt_regs *regs) { u64 curbase = (u64) current; - static unsigned long warned = -60*HZ; + static int not_first_time = 0; + static unsigned long warned; + + if (unlikely(!not_first_time)) { + not_first_time = 1; + warned = -60*HZ; + } if (regs->rsp >= curbase && regs->rsp <= curbase + THREAD_SIZE && regs->rsp < curbase + sizeof(struct task_struct) + 128 && diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/kernel/nmi.c xx/arch/x86_64/kernel/nmi.c --- x-ref/arch/x86_64/kernel/nmi.c 2003-10-02 00:09:42.000000000 +0200 +++ xx/arch/x86_64/kernel/nmi.c 2003-10-02 15:15:49.000000000 +0200 @@ -28,7 +28,8 @@ #include unsigned int nmi_watchdog = NMI_LOCAL_APIC; -static unsigned int nmi_hz = HZ; +static unsigned int __nmi_hz = USER_HZ; +#define nmi_hz user_to_kernel_hz_overflow(__nmi_hz) unsigned int nmi_perfctr_msr; /* the MSR to reset in NMI handler */ int panic_on_timeout; @@ -113,7 +114,7 @@ int __init check_nmi_watchdog (void) /* now that we know it works we can reduce NMI frequency to something more reasonable; makes a difference in some configs */ if (nmi_watchdog == NMI_LOCAL_APIC) - nmi_hz = 1; + __nmi_hz = 1; return 0; } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/kernel/time.c xx/arch/x86_64/kernel/time.c --- x-ref/arch/x86_64/kernel/time.c 2003-10-02 15:15:47.000000000 +0200 +++ xx/arch/x86_64/kernel/time.c 2003-10-02 15:15:49.000000000 +0200 @@ -40,6 +40,7 @@ volatile unsigned long __jiffies __secti unsigned long __wall_jiffies __section_wall_jiffies; struct timeval __xtime __section_xtime; struct timezone __sys_tz __section_sys_tz; +unsigned long ____HZ __section_HZ; static inline void rdtscll_sync(unsigned long *tsc) { @@ -89,7 +90,7 @@ void do_gettimeofday(struct timeval *tv) sec = xtime.tv_sec; usec = xtime.tv_usec - + (jiffies - wall_jiffies) * tick + + (jiffies - wall_jiffies) * get_tick() + do_gettimeoffset(); rmb(); @@ -110,7 +111,7 @@ void do_settimeofday(struct timeval *tv) fr_write_lock_irq(&xtime_lock); vxtime_lock(); - tv->tv_usec -= (jiffies - wall_jiffies) * tick + tv->tv_usec -= (jiffies - wall_jiffies) * get_tick() + do_gettimeoffset(); while (tv->tv_usec < 0) { @@ -246,14 +247,14 @@ static void timer_interrupt(int irq, voi } else { - offset = (((tsc - vxtime.last_tsc) * vxtime.tsc_quot) >> 32) - tick; + offset = (((tsc - vxtime.last_tsc) * vxtime.tsc_quot) >> 32) - get_tick(); - if (offset > tick) { + if (offset > get_tick()) { if (report_lost_ticks) printk(KERN_WARNING "time.c: lost %ld tick(s) (rip %016lx)\n", - offset / tick, regs->rip); - jiffies += offset / tick; - offset %= tick; + offset / get_tick(), regs->rip); + jiffies += offset / get_tick(); + offset %= get_tick(); } vxtime.last_tsc = tsc - vxtime.quot * delay / vxtime.tsc_quot; @@ -279,7 +280,7 @@ static void timer_interrupt(int irq, voi */ if ((~time_status & STA_UNSYNC) && xtime.tv_sec > rtc_update && - abs(xtime.tv_usec - 500000) <= tick / 2) { + abs(xtime.tv_usec - 500000) <= get_tick() / 2) { set_rtc_mmss(xtime.tv_sec); rtc_update = xtime.tv_sec + 660; } @@ -429,7 +430,7 @@ static int hpet_init(void) if (hpet_period < 100000 || hpet_period > 100000000) return -1; - hpet_tick = (1000000000L * tick + hpet_period / 2) / hpet_period; + hpet_tick = (1000000000L * get_tick() + hpet_period / 2) / hpet_period; /* * Stop the timers and reset the main counter. diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/kernel/vsyscall.c xx/arch/x86_64/kernel/vsyscall.c --- x-ref/arch/x86_64/kernel/vsyscall.c 2003-10-02 15:15:47.000000000 +0200 +++ xx/arch/x86_64/kernel/vsyscall.c 2003-10-02 15:15:49.000000000 +0200 @@ -63,7 +63,7 @@ static force_inline void do_vgettimeofda rmb(); sec = __xtime.tv_sec; - usec = __xtime.tv_usec + (__jiffies - __wall_jiffies) * (1000000 / HZ); + usec = __xtime.tv_usec + (__jiffies - __wall_jiffies) * (1000000 / ____HZ); switch (__vxtime.mode) { diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/arch/x86_64/vmlinux.lds xx/arch/x86_64/vmlinux.lds --- x-ref/arch/x86_64/vmlinux.lds 2003-06-13 22:07:24.000000000 +0200 +++ xx/arch/x86_64/vmlinux.lds 2003-10-02 15:15:49.000000000 +0200 @@ -69,6 +69,9 @@ SECTIONS . = ALIGN(16); .xtime : AT ((LOADADDR(.jiffies) + SIZEOF(.jiffies) + 15) & ~(15)) { *(.xtime) } xtime = LOADADDR(.xtime); + . = ALIGN(16); + .__HZ : AT ((LOADADDR(.xtime) + SIZEOF(.xtime) + 15) & ~(15)) { *(.__HZ) } + __HZ = LOADADDR(.__HZ); .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT (LOADADDR(.vsyscall_0) + 1024) { *(.vsyscall_1) } . = LOADADDR(.vsyscall_0) + 4096; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/acpi/osl.c xx/drivers/acpi/osl.c --- x-ref/drivers/acpi/osl.c 2003-08-26 00:12:52.000000000 +0200 +++ xx/drivers/acpi/osl.c 2003-10-02 15:15:49.000000000 +0200 @@ -878,7 +878,7 @@ acpi_os_wait_semaphore( // TODO: A better timeout algorithm? { int i = 0; - static const int quantum_ms = 1000/HZ; + const int quantum_ms = 1000/HZ; ret = down_trylock(sem); for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) { diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/block/floppy.c xx/drivers/block/floppy.c --- x-ref/drivers/block/floppy.c 2003-08-26 00:12:54.000000000 +0200 +++ xx/drivers/block/floppy.c 2003-10-02 15:15:49.000000000 +0200 @@ -350,7 +350,7 @@ static int inr; /* size of reply buffer, #define R_SECTOR (reply_buffer[5]) #define R_SIZECODE (reply_buffer[6]) -#define SEL_DLY (2*HZ/100) +#define SEL_DLY (2*USER_HZ/100) /* * this struct defines the different floppy drive types. @@ -374,26 +374,26 @@ static struct { | | | | | | | | | | | Interrupt timeout | | | | | | | | | | | | Max nonintlv. sectors | | | | | | | | | | | | | -Max Errors- flags */ -{{0, 500, 16, 16, 8000, 1*HZ, 3*HZ, 0, SEL_DLY, 5, 80, 3*HZ, 20, {3,1,2,0,2}, 0, - 0, { 7, 4, 8, 2, 1, 5, 3,10}, 3*HZ/2, 0 }, "unknown" }, +{{0, 500, 16, 16, 8000, 1*USER_HZ, 3*USER_HZ, 0, SEL_DLY, 5, 80, 3*USER_HZ, 20, {3,1,2,0,2}, 0, + 0, { 7, 4, 8, 2, 1, 5, 3,10}, 3*USER_HZ/2, 0 }, "unknown" }, -{{1, 300, 16, 16, 8000, 1*HZ, 3*HZ, 0, SEL_DLY, 5, 40, 3*HZ, 17, {3,1,2,0,2}, 0, - 0, { 1, 0, 0, 0, 0, 0, 0, 0}, 3*HZ/2, 1 }, "360K PC" }, /*5 1/4 360 KB PC*/ +{{1, 300, 16, 16, 8000, 1*USER_HZ, 3*USER_HZ, 0, SEL_DLY, 5, 40, 3*USER_HZ, 17, {3,1,2,0,2}, 0, + 0, { 1, 0, 0, 0, 0, 0, 0, 0}, 3*USER_HZ/2, 1 }, "360K PC" }, /*5 1/4 360 KB PC*/ -{{2, 500, 16, 16, 6000, 4*HZ/10, 3*HZ, 14, SEL_DLY, 6, 83, 3*HZ, 17, {3,1,2,0,2}, 0, - 0, { 2, 5, 6,23,10,20,12, 0}, 3*HZ/2, 2 }, "1.2M" }, /*5 1/4 HD AT*/ +{{2, 500, 16, 16, 6000, 4*USER_HZ/10, 3*USER_HZ, 14, SEL_DLY, 6, 83, 3*USER_HZ, 17, {3,1,2,0,2}, 0, + 0, { 2, 5, 6,23,10,20,12, 0}, 3*USER_HZ/2, 2 }, "1.2M" }, /*5 1/4 HD AT*/ -{{3, 250, 16, 16, 3000, 1*HZ, 3*HZ, 0, SEL_DLY, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0, - 0, { 4,22,21,30, 3, 0, 0, 0}, 3*HZ/2, 4 }, "720k" }, /*3 1/2 DD*/ +{{3, 250, 16, 16, 3000, 1*USER_HZ, 3*USER_HZ, 0, SEL_DLY, 5, 83, 3*USER_HZ, 20, {3,1,2,0,2}, 0, + 0, { 4,22,21,30, 3, 0, 0, 0}, 3*USER_HZ/2, 4 }, "720k" }, /*3 1/2 DD*/ -{{4, 500, 16, 16, 4000, 4*HZ/10, 3*HZ, 10, SEL_DLY, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0, - 0, { 7, 4,25,22,31,21,29,11}, 3*HZ/2, 7 }, "1.44M" }, /*3 1/2 HD*/ +{{4, 500, 16, 16, 4000, 4*USER_HZ/10, 3*USER_HZ, 10, SEL_DLY, 5, 83, 3*USER_HZ, 20, {3,1,2,0,2}, 0, + 0, { 7, 4,25,22,31,21,29,11}, 3*USER_HZ/2, 7 }, "1.44M" }, /*3 1/2 HD*/ -{{5, 1000, 15, 8, 3000, 4*HZ/10, 3*HZ, 10, SEL_DLY, 5, 83, 3*HZ, 40, {3,1,2,0,2}, 0, - 0, { 7, 8, 4,25,28,22,31,21}, 3*HZ/2, 8 }, "2.88M AMI BIOS" }, /*3 1/2 ED*/ +{{5, 1000, 15, 8, 3000, 4*USER_HZ/10, 3*USER_HZ, 10, SEL_DLY, 5, 83, 3*USER_HZ, 40, {3,1,2,0,2}, 0, + 0, { 7, 8, 4,25,28,22,31,21}, 3*USER_HZ/2, 8 }, "2.88M AMI BIOS" }, /*3 1/2 ED*/ -{{6, 1000, 15, 8, 3000, 4*HZ/10, 3*HZ, 10, SEL_DLY, 5, 83, 3*HZ, 40, {3,1,2,0,2}, 0, - 0, { 7, 8, 4,25,28,22,31,21}, 3*HZ/2, 8 }, "2.88M" } /*3 1/2 ED*/ +{{6, 1000, 15, 8, 3000, 4*USER_HZ/10, 3*USER_HZ, 10, SEL_DLY, 5, 83, 3*USER_HZ, 40, {3,1,2,0,2}, 0, + 0, { 7, 8, 4,25,28,22,31,21}, 3*USER_HZ/2, 8 }, "2.88M" } /*3 1/2 ED*/ /* | --autodetected formats--- | | | * read_track | | Name printed when booting * | Native format @@ -661,7 +661,7 @@ static void __reschedule_timeout(int dri fd_timeout.expires = jiffies + 20UL*HZ; drive=0; } else - fd_timeout.expires = jiffies + UDP->timeout; + fd_timeout.expires = jiffies + user_to_kernel_hz_overflow(UDP->__timeout); add_timer(&fd_timeout); if (UDP->flags & FD_DEBUG){ DPRINT("reschedule timeout "); @@ -737,7 +737,7 @@ static int disk_change(int drive) { int fdc=FDC(drive); #ifdef FLOPPY_SANITY_CHECK - if (jiffies - UDRS->select_date < UDP->select_delay) + if (jiffies - UDRS->select_date < user_to_kernel_hz_overflow(UDP->__select_delay)) DPRINT("WARNING disk change called early\n"); if (!(FDCS->dor & (0x10 << UNIT(drive))) || (FDCS->dor & 3) != UNIT(drive) || @@ -832,7 +832,7 @@ static int set_dor(int fdc, char mask, c static void twaddle(void) { - if (DP->select_delay) + if (user_to_kernel_hz_overflow(DP->__select_delay)) return; fd_outb(FDCS->dor & ~(0x10<dor, FD_DOR); @@ -969,7 +969,7 @@ static void floppy_off(unsigned int driv delta = jiffies - UDRS->first_read_date + HZ - UDP->spindown_offset; delta = ((delta * UDP->rps) % HZ) / UDP->rps; - motor_off_timer[drive].expires = jiffies + UDP->spindown - delta; + motor_off_timer[drive].expires = jiffies + user_to_kernel_hz_overflow(UDP->__spindown) - delta; } add_timer(motor_off_timer+drive); } @@ -983,13 +983,13 @@ static void scandrives(void) { int i, drive, saved_drive; - if (DP->select_delay) + if (DP->__select_delay) return; saved_drive = current_drive; for (i=0; i < N_DRIVE; i++){ drive = (saved_drive + i + 1) % N_DRIVE; - if (UDRS->fd_ref == 0 || UDP->select_delay != 0) + if (UDRS->fd_ref == 0 || UDP->__select_delay != 0) continue; /* skip closed drives */ set_fdc(drive); if (!(set_dor(fdc, ~3, UNIT(drive) | (0x10 << UNIT(drive))) & @@ -1520,13 +1520,13 @@ static void setup_rw_floppy(void) flags |= FD_RAW_INTR; if ((flags & FD_RAW_SPIN) && !(flags & FD_RAW_NO_MOTOR)){ - ready_date = DRS->spinup_date + DP->spinup; + ready_date = DRS->spinup_date + user_to_kernel_hz_overflow(DP->__spinup); /* If spinup will take a long time, rerun scandrives * again just before spinup completion. Beware that * after scandrives, we must again wait for selection. */ - if ((signed) (ready_date - jiffies) > DP->select_delay){ - ready_date -= DP->select_delay; + if ((signed) (ready_date - jiffies) > user_to_kernel_hz_overflow(DP->__select_delay)){ + ready_date -= user_to_kernel_hz_overflow(DP->__select_delay); function = (timeout_fn) floppy_start; } else function = (timeout_fn) setup_rw_floppy; @@ -1962,7 +1962,7 @@ static int start_motor(void (*function)( set_dor(fdc, mask, data); /* wait_for_completion also schedules reset if needed. */ - return(fd_wait_for_completion(DRS->select_date+DP->select_delay, + return(fd_wait_for_completion(DRS->select_date+user_to_kernel_hz_overflow(DP->__select_delay), (timeout_fn) function)); } @@ -1979,7 +1979,7 @@ static void floppy_ready(void) #endif if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && disk_change(current_drive) && - !DP->select_delay) + !user_to_kernel_hz_overflow(DP->__select_delay)) twaddle(); /* this clears the dcl on certain drive/controller * combinations */ @@ -3844,7 +3844,7 @@ static int check_floppy_change(kdev_t de if (UTESTF(FD_DISK_CHANGED) || UTESTF(FD_VERIFY)) return 1; - if (UDP->checkfreq < (int)(jiffies - UDRS->last_checked)) { + if (user_to_kernel_hz_overflow(UDP->__checkfreq) < (int)(jiffies - UDRS->last_checked)) { if(floppy_grab_irq_and_dma()) { return 1; } @@ -4063,10 +4063,10 @@ static void __init daring(int *ints,int for (i=0; i < ARRAY_SIZE(default_drive_params); i++){ if (param){ - default_drive_params[i].params.select_delay = 0; + default_drive_params[i].params.__select_delay = 0; default_drive_params[i].params.flags |= FD_SILENT_DCL_CLEAR; } else { - default_drive_params[i].params.select_delay = 2*HZ/100; + default_drive_params[i].params.__select_delay = 2*USER_HZ/100; default_drive_params[i].params.flags &= ~FD_SILENT_DCL_CLEAR; } } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/char/console.c xx/drivers/char/console.c --- x-ref/drivers/char/console.c 2003-10-02 00:09:43.000000000 +0200 +++ xx/drivers/char/console.c 2003-10-02 15:15:49.000000000 +0200 @@ -163,7 +163,7 @@ int do_poke_blanked_console; int console_blanked; static int vesa_blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */ -static int blankinterval = 10*60*HZ; +static int blankinterval; static int vesa_off_interval; static struct tq_struct console_callback_tq = { @@ -2502,6 +2502,7 @@ void __init con_init(void) init_timer(&console_timer); console_timer.function = blank_screen; + blankinterval = 10*60*HZ; if (blankinterval) { mod_timer(&console_timer, jiffies + blankinterval); } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/char/cyclades.c xx/drivers/char/cyclades.c --- x-ref/drivers/char/cyclades.c 2003-06-13 22:07:24.000000000 +0200 +++ xx/drivers/char/cyclades.c 2003-10-02 15:15:49.000000000 +0200 @@ -882,7 +882,8 @@ static int cyclades_get_proc_info(char * static void cyz_poll(unsigned long); /* The Cyclades-Z polling cycle is defined by this variable */ -static long cyz_polling_cycle = CZ_DEF_POLL; +static long __cyz_polling_cycle = CZ_DEF_POLL; +#define cyz_polling_cycle user_to_kernel_hz_overflow(__cyz_polling_cycle) static int cyz_timeron = 0; static struct timer_list cyz_timerlist = { @@ -4306,11 +4307,11 @@ cy_ioctl(struct tty_struct *tty, struct break; #ifndef CONFIG_CYZ_INTR case CYZSETPOLLCYCLE: - cyz_polling_cycle = (arg * HZ) / 1000; + __cyz_polling_cycle = (arg * USER_HZ) / 1000; ret_val = 0; break; case CYZGETPOLLCYCLE: - ret_val = (cyz_polling_cycle * 1000) / HZ; + ret_val = (__cyz_polling_cycle * 1000) / USER_HZ; break; #endif /* CONFIG_CYZ_INTR */ case CYSETWAIT: diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/char/pc110pad.c xx/drivers/char/pc110pad.c --- x-ref/drivers/char/pc110pad.c 2003-03-15 03:25:01.000000000 +0100 +++ xx/drivers/char/pc110pad.c 2003-10-02 15:15:49.000000000 +0200 @@ -56,8 +56,8 @@ static struct pc110pad_params default_params = { mode: PC110PAD_PS2, - bounce_interval: 50 MS, - tap_interval: 200 MS, + __bounce_interval: 50 MS, + __tap_interval: 200 MS, irq: 10, io: 0x15E0, }; @@ -164,7 +164,7 @@ void notify_pad_up_down(void) transition_count=1; recent_transition=1; } - mod_timer(&tap_timer, jiffies + current_params.tap_interval); + mod_timer(&tap_timer, jiffies + user_to_kernel_hz_overflow(current_params.__tap_interval)); /* changes to transition_count can cause reported button to change */ button_pending = 1; @@ -356,7 +356,7 @@ static void pad_irq(int irq, void *ptr, { bounce=JUST_GONE_DOWN; mod_timer(&bounce_timer, - jiffies+current_params.bounce_interval); + jiffies+user_to_kernel_hz_overflow(current_params.__bounce_interval)); /* start new stroke/tap */ debounced_down=new_down; notify_pad_up_down(); @@ -378,7 +378,7 @@ static void pad_irq(int irq, void *ptr, /* don't trust it yet */ bounce=JUST_GONE_UP; mod_timer(&bounce_timer, - jiffies+current_params.bounce_interval); + jiffies+user_to_kernel_hz_overflow(current_params.__bounce_interval)); } } } @@ -756,14 +756,14 @@ static int pad_ioctl(struct inode *inode if( (new.modePC110PAD_PS2) - || (new.bounce_interval<0) - || (new.tap_interval<0) + || (new.__bounce_interval<0) + || (new.__tap_interval<0) ) return -EINVAL; current_params.mode = new.mode; - current_params.bounce_interval = new.bounce_interval; - current_params.tap_interval = new.tap_interval; + current_params.__bounce_interval = new.__bounce_interval; + current_params.__tap_interval = new.__tap_interval; return 0; } return -ENOTTY; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/char/pc110pad.h xx/drivers/char/pc110pad.h --- x-ref/drivers/char/pc110pad.h 2003-03-15 03:25:01.000000000 +0100 +++ xx/drivers/char/pc110pad.h 2003-10-02 15:15:49.000000000 +0200 @@ -13,13 +13,13 @@ enum pc110pad_mode { struct pc110pad_params { enum pc110pad_mode mode; - int bounce_interval; - int tap_interval; + int __bounce_interval; + int __tap_interval; int irq; int io; }; -#define MS *HZ/1000 +#define MS *USER_HZ/1000 /* Appears as device major=10 (MISC), minor=PC110_PAD */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/char/pc_keyb.c xx/drivers/char/pc_keyb.c --- x-ref/drivers/char/pc_keyb.c 2003-03-15 03:25:01.000000000 +0100 +++ xx/drivers/char/pc_keyb.c 2003-10-02 15:15:49.000000000 +0200 @@ -1225,7 +1225,7 @@ static int __init psaux_init(void) #endif /* CONFIG_PSMOUSE */ -static int blink_frequency = HZ/2; +static int blink_frequency; /* Tell the user who may be running in X and not see the console that we have panic'ed. This is to distingush panics from "real" lockups. diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/char/rio/rio_linux.c xx/drivers/char/rio/rio_linux.c --- x-ref/drivers/char/rio/rio_linux.c 2003-03-15 03:25:00.000000000 +0100 +++ xx/drivers/char/rio/rio_linux.c 2003-10-02 15:15:49.000000000 +0200 @@ -166,7 +166,7 @@ static struct Conf RIOConf = { /* locator */ "RIO Config here", - /* startuptime */ HZ*2, /* how long to wait for card to run */ + /* startuptime */ USER_HZ*2, /* how long to wait for card to run */ /* slowcook */ 0, /* TRUE -> always use line disc. */ /* intrpolltime */ 1, /* The frequency of OUR polls */ /* breakinterval */ 25, /* x10 mS XXX: units seem to be 1ms not 10! -- REW*/ @@ -185,7 +185,7 @@ RIOConf = /* BufferSize */ 1024, /* Bytes per port of buffering */ /* LowWater */ 256, /* how much data left before wakeup */ /* LineLength */ 80, /* how wide is the console? */ - /* CmdTimeout */ HZ, /* how long a close command may take */ + /* CmdTimeout */ USER_HZ, /* how long a close command may take */ }; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/char/rio/rioboot.c xx/drivers/char/rio/rioboot.c --- x-ref/drivers/char/rio/rioboot.c 2003-06-13 22:07:25.000000000 +0200 +++ xx/drivers/char/rio/rioboot.c 2003-10-02 15:15:49.000000000 +0200 @@ -479,7 +479,7 @@ register struct DownLoad *rbp; ** Now, wait for upto five seconds for the Tp to setup the parmmap ** pointer: */ - for ( wait_count=0; (wait_countRIOConf.StartupTime)&& + for ( wait_count=0; (wait_countRIOConf.__StartupTime))&& (RWORD(HostP->__ParmMapR)==OldParmMap); wait_count++ ) { rio_dprintk (RIO_DEBUG_BOOT, "Checkout %d, 0x%x\n",wait_count,RWORD(HostP->__ParmMapR)); delay(HostP, HUNDRED_MS); @@ -537,9 +537,9 @@ register struct DownLoad *rbp; ** now wait for the card to set all the parmmap->XXX stuff ** this is a wait of upto two seconds.... */ - rio_dprintk (RIO_DEBUG_BOOT, "Looking for init_done - %d ticks\n",p->RIOConf.StartupTime); + rio_dprintk (RIO_DEBUG_BOOT, "Looking for init_done - %d ticks\n", user_to_kernel_hz_overflow(p->RIOConf.__StartupTime)); HostP->timeout_id = 0; - for ( wait_count=0; (wait_countRIOConf.StartupTime) && + for ( wait_count=0; (wait_countRIOConf.__StartupTime)) && !RWORD(ParmMapP->init_done); wait_count++ ) { rio_dprintk (RIO_DEBUG_BOOT, "Waiting for init_done\n"); delay(HostP, HUNDRED_MS); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/char/rio/riospace.h xx/drivers/char/rio/riospace.h --- x-ref/drivers/char/rio/riospace.h 2003-03-15 03:25:01.000000000 +0100 +++ xx/drivers/char/rio/riospace.h 2003-10-02 15:15:49.000000000 +0200 @@ -50,7 +50,7 @@ static char *_riospace_h_sccs_ = "@(#)ri struct Conf { char Locator[24]; - unsigned int StartupTime; + unsigned int __StartupTime; unsigned int SlowCook; unsigned int IntrPollTime; unsigned int BreakInterval; @@ -69,7 +69,7 @@ struct Conf unsigned int BufferSize; unsigned int LowWater; unsigned int LineLength; - unsigned int CmdTime; + unsigned int __CmdTime; }; /* diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/isdn/isdn_common.c xx/drivers/isdn/isdn_common.c --- x-ref/drivers/isdn/isdn_common.c 2003-03-15 03:25:02.000000000 +0100 +++ xx/drivers/isdn/isdn_common.c 2003-10-02 15:15:49.000000000 +0200 @@ -2318,6 +2318,9 @@ static int __init isdn_init(void) { int i; char tmprev[50]; + extern unsigned long __last_jiffies; + + __last_jiffies = -HZ; if (!(dev = (isdn_dev *) vmalloc(sizeof(isdn_dev)))) { printk(KERN_WARNING "isdn: Could not allocate device-struct.\n"); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/isdn/isdn_net.c xx/drivers/isdn/isdn_net.c --- x-ref/drivers/isdn/isdn_net.c 2003-08-26 00:12:55.000000000 +0200 +++ xx/drivers/isdn/isdn_net.c 2003-10-02 15:15:49.000000000 +0200 @@ -330,7 +330,7 @@ isdn_net_unbind_channel(isdn_net_local * * Since this function is called every second, simply reset the * byte-counter of the interface after copying it to the cps-variable. */ -unsigned long last_jiffies = -HZ; +unsigned long __last_jiffies; void isdn_net_autohup() @@ -341,10 +341,10 @@ isdn_net_autohup() anymore = 0; while (p) { isdn_net_local *l = p->local; - if (jiffies == last_jiffies) + if (jiffies == __last_jiffies) l->cps = l->transcount; else - l->cps = (l->transcount * HZ) / (jiffies - last_jiffies); + l->cps = (l->transcount * HZ) / (jiffies - __last_jiffies); l->transcount = 0; if (dev->net_verbose > 3) printk(KERN_DEBUG "%s: %d bogocps\n", l->name, l->cps); @@ -390,7 +390,7 @@ isdn_net_autohup() } p = (isdn_net_dev *) p->next; } - last_jiffies = jiffies; + __last_jiffies = jiffies; isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, anymore); } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/mtd/devices/doc1000.c xx/drivers/mtd/devices/doc1000.c --- x-ref/drivers/mtd/devices/doc1000.c 2003-06-13 22:07:29.000000000 +0200 +++ xx/drivers/mtd/devices/doc1000.c 2003-10-02 15:15:49.000000000 +0200 @@ -29,7 +29,7 @@ /* Parameters that can be set with 'insmod' */ static u_long base = 0xe0000; -static int erase_timeout = 10*HZ; /* in ticks */ +static int erase_timeout = 10*USER_HZ; /* in ticks */ static int retry_limit = 4; /* write retries */ static u_long max_tries = 4096; /* status polling */ @@ -481,7 +481,7 @@ static void flashcard_periodic(unsigned else priv->devstat[erase->dev] = erase->state = MTD_ERASE_PENDING; } - else if (time_after(jiffies, erase->time + erase_timeout)) + else if (time_after(jiffies, erase->time + user_to_kernel_hz_overflow(erase_timeout))) { printk("Flash erase timed out. The world is broken.\n"); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/net/3c515.c xx/drivers/net/3c515.c --- x-ref/drivers/net/3c515.c 2003-10-02 00:09:43.000000000 +0200 +++ xx/drivers/net/3c515.c 2003-10-02 15:15:49.000000000 +0200 @@ -359,15 +359,15 @@ static struct media_table { unsigned int media_bits:16, /* Bits to set in Wn4_Media register. */ mask:8, /* The transceiver-present bit in Wn3_Config. */ next:8; /* The media type to try next. */ - short wait; /* Time before we check media status. */ + short __wait; /* Time before we check media status. */ } media_tbl[] = { - { "10baseT", Media_10TP, 0x08, XCVR_10base2, (14 * HZ) / 10 }, - { "10Mbs AUI", Media_SQE, 0x20, XCVR_Default, (1 * HZ) / 10}, + { "10baseT", Media_10TP, 0x08, XCVR_10base2, (14 * USER_HZ) / 10 }, + { "10Mbs AUI", Media_SQE, 0x20, XCVR_Default, (1 * USER_HZ) / 10}, { "undefined", 0, 0x80, XCVR_10baseT, 10000}, - { "10base2", 0, 0x10, XCVR_AUI, (1 * HZ) / 10}, - { "100baseTX", Media_Lnk, 0x02, XCVR_100baseFx, (14 * HZ) / 10}, - { "100baseFX", Media_Lnk, 0x04, XCVR_MII, (14 * HZ) / 10}, - { "MII", 0, 0x40, XCVR_10baseT, 3 * HZ}, + { "10base2", 0, 0x10, XCVR_AUI, (1 * USER_HZ) / 10}, + { "100baseTX", Media_Lnk, 0x02, XCVR_100baseFx, (14 * USER_HZ) / 10}, + { "100baseFX", Media_Lnk, 0x04, XCVR_MII, (14 * USER_HZ) / 10}, + { "MII", 0, 0x40, XCVR_10baseT, 3 * USER_HZ}, { "undefined", 0, 0x01, XCVR_10baseT, 10000}, { "Default", 0, 0xFF, XCVR_10baseT, 10000}, }; @@ -773,7 +773,7 @@ static int corkscrew_open(struct net_dev dev->name, media_tbl[dev->if_port].name); init_timer(&vp->timer); - vp->timer.expires = RUN_AT(media_tbl[dev->if_port].wait); + vp->timer.expires = RUN_AT(user_to_kernel_hz_overflow(media_tbl[dev->if_port].__wait)); vp->timer.data = (unsigned long) dev; vp->timer.function = &corkscrew_timer; /* timer handler */ add_timer(&vp->timer); @@ -973,7 +973,7 @@ static void corkscrew_timer(unsigned lon printk("%s: Media selection failed, now trying %s port.\n", dev->name, media_tbl[dev->if_port].name); - vp->timer.expires = RUN_AT(media_tbl[dev->if_port].wait); + vp->timer.expires = RUN_AT(user_to_kernel_hz_overflow(media_tbl[dev->if_port].__wait)); add_timer(&vp->timer); } outw((media_status & ~(Media_10TP | Media_SQE)) | diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/net/3c59x.c xx/drivers/net/3c59x.c --- x-ref/drivers/net/3c59x.c 2003-10-02 15:15:33.000000000 +0200 +++ xx/drivers/net/3c59x.c 2003-10-02 15:15:49.000000000 +0200 @@ -835,18 +835,18 @@ static struct media_table { unsigned int media_bits:16, /* Bits to set in Wn4_Media register. */ mask:8, /* The transceiver-present bit in Wn3_Config.*/ next:8; /* The media type to try next. */ - int wait; /* Time before we check media status. */ + int __wait; /* Time before we check media status. */ } media_tbl[] = { - { "10baseT", Media_10TP,0x08, XCVR_10base2, (14*HZ)/10}, - { "10Mbs AUI", Media_SQE, 0x20, XCVR_Default, (1*HZ)/10}, + { "10baseT", Media_10TP,0x08, XCVR_10base2, (14*USER_HZ)/10}, + { "10Mbs AUI", Media_SQE, 0x20, XCVR_Default, (1*USER_HZ)/10}, { "undefined", 0, 0x80, XCVR_10baseT, 10000}, - { "10base2", 0, 0x10, XCVR_AUI, (1*HZ)/10}, - { "100baseTX", Media_Lnk, 0x02, XCVR_100baseFx, (14*HZ)/10}, - { "100baseFX", Media_Lnk, 0x04, XCVR_MII, (14*HZ)/10}, - { "MII", 0, 0x41, XCVR_10baseT, 3*HZ }, + { "10base2", 0, 0x10, XCVR_AUI, (1*USER_HZ)/10}, + { "100baseTX", Media_Lnk, 0x02, XCVR_100baseFx, (14*USER_HZ)/10}, + { "100baseFX", Media_Lnk, 0x04, XCVR_MII, (14*USER_HZ)/10}, + { "MII", 0, 0x41, XCVR_10baseT, 3*USER_HZ }, { "undefined", 0, 0x01, XCVR_10baseT, 10000}, - { "Autonegotiate", 0, 0x41, XCVR_10baseT, 3*HZ}, - { "MII-External", 0, 0x41, XCVR_10baseT, 3*HZ }, + { "Autonegotiate", 0, 0x41, XCVR_10baseT, 3*USER_HZ}, + { "MII-External", 0, 0x41, XCVR_10baseT, 3*USER_HZ }, { "Default", 0, 0xFF, XCVR_10baseT, 10000}, }; @@ -1450,7 +1450,7 @@ vortex_up(struct net_device *dev) } init_timer(&vp->timer); - vp->timer.expires = RUN_AT(media_tbl[dev->if_port].wait); + vp->timer.expires = RUN_AT(user_to_kernel_hz_overflow(media_tbl[dev->if_port].__wait)); vp->timer.data = (unsigned long)dev; vp->timer.function = vortex_timer; /* timer handler */ add_timer(&vp->timer); @@ -1756,7 +1756,7 @@ vortex_timer(unsigned long data) printk(KERN_DEBUG "%s: Media selection failed, now trying " "%s port.\n", dev->name, media_tbl[dev->if_port].name); - next_tick = media_tbl[dev->if_port].wait; + next_tick = user_to_kernel_hz_overflow(media_tbl[dev->if_port].__wait); } outw((media_status & ~(Media_10TP|Media_SQE)) | media_tbl[dev->if_port].media_bits, ioaddr + Wn4_Media); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/net/8139too.c xx/drivers/net/8139too.c --- x-ref/drivers/net/8139too.c 2003-10-02 00:09:43.000000000 +0200 +++ xx/drivers/net/8139too.c 2003-10-02 15:15:49.000000000 +0200 @@ -1423,7 +1423,7 @@ static void rtl8139_init_ring (struct ne /* This must be global for CONFIG_8139TOO_TUNE_TWISTER case */ -static int next_tick = 3 * HZ; +static int next_tick; #ifndef CONFIG_8139TOO_TUNE_TWISTER static inline void rtl8139_tune_twister (struct net_device *dev, @@ -2523,6 +2523,8 @@ static int __init rtl8139_init_module (v printk (KERN_INFO RTL8139_DRIVER_NAME "\n"); #endif + next_tick = 3 * HZ; + return pci_module_init (&rtl8139_pci_driver); } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/net/amd8111e.c xx/drivers/net/amd8111e.c --- x-ref/drivers/net/amd8111e.c 2003-10-02 15:15:33.000000000 +0200 +++ xx/drivers/net/amd8111e.c 2003-10-02 15:15:49.000000000 +0200 @@ -1705,7 +1705,7 @@ static int amd8111e_resume(struct pci_de /* Restart ipg timer */ if(lp->options & OPTION_DYN_IPG_ENABLE) mod_timer(&lp->ipg_data.ipg_timer, - jiffies + (IPG_CONVERGE_TIME * HZ)); + jiffies + (HZ/ IPG_CONVERGE_TIME)); spin_unlock_irq(&lp->lock); return 0; @@ -1779,7 +1779,7 @@ static void amd8111e_config_ipg(struct n writew((u32)tmp_ipg, mmio + IPG); writew((u32)(tmp_ipg - IFS1_DELTA), mmio + IFS1); } - mod_timer(&lp->ipg_data.ipg_timer, jiffies + (IPG_CONVERGE_TIME * HZ)); + mod_timer(&lp->ipg_data.ipg_timer, jiffies + (HZ / IPG_CONVERGE_TIME)); return; } @@ -1920,7 +1920,7 @@ static int __devinit amd8111e_probe_one( lp->ipg_data.ipg_timer.data = (unsigned long) dev; lp->ipg_data.ipg_timer.function = (void *)&amd8111e_config_ipg; lp->ipg_data.ipg_timer.expires = jiffies + - IPG_CONVERGE_TIME * HZ; + HZ / IPG_CONVERGE_TIME; lp->ipg_data.ipg = DEFAULT_IPG; lp->ipg_data.ipg_state = CSTATE; }; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/net/amd8111e.h xx/drivers/net/amd8111e.h --- x-ref/drivers/net/amd8111e.h 2003-08-26 00:12:55.000000000 +0200 +++ xx/drivers/net/amd8111e.h 2003-10-02 15:15:49.000000000 +0200 @@ -606,7 +606,7 @@ typedef enum { /* ipg parameters */ #define DEFAULT_IPG 0x60 #define IFS1_DELTA 36 -#define IPG_CONVERGE_TIME 0.5 +#define IPG_CONVERGE_TIME 2 #define IPG_STABLE_TIME 5 #define MIN_IPG 96 #define MAX_IPG 255 diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/net/ppp_async.c xx/drivers/net/ppp_async.c --- x-ref/drivers/net/ppp_async.c 2003-03-15 03:25:04.000000000 +0100 +++ xx/drivers/net/ppp_async.c 2003-10-02 15:15:49.000000000 +0200 @@ -80,9 +80,9 @@ struct asyncppp { /* Bits in rbits */ #define SC_RCV_BITS (SC_RCV_B7_1|SC_RCV_B7_0|SC_RCV_ODDP|SC_RCV_EVNP) -static int flag_time = HZ; +static int flag_time = USER_HZ; MODULE_PARM(flag_time, "i"); -MODULE_PARM_DESC(flag_time, "ppp_async: interval between flagged packets (in clock ticks)"); +MODULE_PARM_DESC(flag_time, "ppp_async: interval between flagged packets (in USER_HZ clock ticks)"); MODULE_LICENSE("GPL"); @@ -551,7 +551,7 @@ ppp_async_encode(struct asyncppp *ap) * character if necessary. */ if (islcp || flag_time == 0 - || jiffies - ap->last_xmit >= flag_time) + || jiffies - ap->last_xmit >= user_to_kernel_hz_overflow(flag_time)) *buf++ = PPP_FLAG; ap->last_xmit = jiffies; fcs = PPP_INITFCS; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/net/sb1000.c xx/drivers/net/sb1000.c --- x-ref/drivers/net/sb1000.c 2003-03-15 03:25:04.000000000 +0100 +++ xx/drivers/net/sb1000.c 2003-10-02 15:15:49.000000000 +0200 @@ -276,7 +276,7 @@ sb1000_probe(struct net_device *dev) * SB1000 hardware routines to be used during open/configuration phases */ -const int TimeOutJiffies = (875 * HZ) / 100; +#define TimeOutJiffies ((875 * HZ) / 100) static inline void nicedelay(unsigned long usecs) { @@ -387,7 +387,7 @@ card_send_command(const int ioaddr[], co /* * SB1000 hardware routines to be used during frame rx interrupt */ -const int Sb1000TimeOutJiffies = 7 * HZ; +#define Sb1000TimeOutJiffies (7 * HZ) /* Card Wait For Ready (to be used during frame rx) */ static inline int diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/net/sis900.c xx/drivers/net/sis900.c --- x-ref/drivers/net/sis900.c 2003-10-02 00:09:44.000000000 +0200 +++ xx/drivers/net/sis900.c 2003-10-02 15:15:49.000000000 +0200 @@ -1183,7 +1183,7 @@ static void sis900_timer(unsigned long d struct net_device *net_dev = (struct net_device *)data; struct sis900_private *sis_priv = net_dev->priv; struct mii_phy *mii_phy = sis_priv->mii; - static int next_tick = 5*HZ; + static const int next_tick = 5*USER_HZ; u16 status; u8 revision; @@ -1236,7 +1236,7 @@ static void sis900_timer(unsigned long d } } - sis_priv->timer.expires = jiffies + next_tick; + sis_priv->timer.expires = jiffies + user_to_kernel_hz_overflow(next_tick); add_timer(&sis_priv->timer); } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/net/strip.c xx/drivers/net/strip.c --- x-ref/drivers/net/strip.c 2003-03-15 03:25:04.000000000 +0100 +++ xx/drivers/net/strip.c 2003-10-02 15:15:49.000000000 +0200 @@ -436,7 +436,7 @@ static const MetricomKey ACK_Key static const MetricomKey INF_Key = { { "INF_" } }; static const MetricomKey ERR_Key = { { "ERR_" } }; -static const long MaxARPInterval = 60 * HZ; /* One minute */ +#define MaxARPInterval (60 * HZ) /* One minute */ /* * Maximum Starmode packet length is 1183 bytes. Allowing 4 bytes for diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/parport/procfs.c xx/drivers/parport/procfs.c --- x-ref/drivers/parport/procfs.c 2003-03-15 03:25:04.000000000 +0100 +++ xx/drivers/parport/procfs.c 2003-10-02 15:15:49.000000000 +0200 @@ -26,7 +26,7 @@ #if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS) #define PARPORT_MIN_TIMESLICE_VALUE 1ul -#define PARPORT_MAX_TIMESLICE_VALUE ((unsigned long) HZ) +#define PARPORT_MAX_TIMESLICE_VALUE ((unsigned long) USER_HZ) #define PARPORT_MIN_SPINTIME_VALUE 1 #define PARPORT_MAX_SPINTIME_VALUE 1000 @@ -345,7 +345,7 @@ struct parport_default_sysctl_table ctl_table dev_dir[2]; }; -extern unsigned long parport_default_timeslice; +extern unsigned long __parport_default_timeslice; extern int parport_default_spintime; static struct parport_default_sysctl_table @@ -353,8 +353,8 @@ parport_default_sysctl_table = { NULL, { { DEV_PARPORT_DEFAULT_TIMESLICE, "timeslice", - &parport_default_timeslice, - sizeof(parport_default_timeslice), 0644, NULL, + &__parport_default_timeslice, + sizeof(__parport_default_timeslice), 0644, NULL, &proc_doulongvec_ms_jiffies_minmax, NULL, NULL, (void*) &parport_min_timeslice_value, (void*) &parport_max_timeslice_value }, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/parport/share.c xx/drivers/parport/share.c --- x-ref/drivers/parport/share.c 2003-03-15 03:25:04.000000000 +0100 +++ xx/drivers/parport/share.c 2003-10-02 15:15:49.000000000 +0200 @@ -36,9 +36,10 @@ #undef PARPORT_PARANOID -#define PARPORT_DEFAULT_TIMESLICE (HZ/5) +#define PARPORT_DEFAULT_TIMESLICE (USER_HZ/5) -unsigned long parport_default_timeslice = PARPORT_DEFAULT_TIMESLICE; +unsigned long __parport_default_timeslice = PARPORT_DEFAULT_TIMESLICE; +#define parport_default_timeslice user_to_kernel_hz_overflow(__parport_default_timeslice) int parport_default_spintime = DEFAULT_SPIN_TIME; static struct parport *portlist = NULL, *portlist_tail = NULL; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/pcmcia/tcic.c xx/drivers/pcmcia/tcic.c --- x-ref/drivers/pcmcia/tcic.c 2003-03-15 03:25:04.000000000 +0100 +++ xx/drivers/pcmcia/tcic.c 2003-10-02 15:15:49.000000000 +0200 @@ -95,7 +95,7 @@ static int cs_irq = 0; static int poll_interval = 0; /* Delay for card status double-checking */ -static int poll_quick = HZ/20; +static int poll_quick = USER_HZ/20; /* CCLK external clock time, in nanoseconds. 70 ns = 14.31818 MHz */ static int cycle_time = 70; @@ -602,7 +602,7 @@ static void tcic_interrupt(int irq, void /* Schedule next poll, if needed */ if (((cs_irq == 0) || quick) && (!tcic_timer_pending)) { - poll_timer.expires = jiffies + (quick ? poll_quick : poll_interval); + poll_timer.expires = jiffies + (quick ? user_to_kernel_hz_overflow(poll_quick) : poll_interval); add_timer(&poll_timer); tcic_timer_pending = 1; } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/sound/wavfront.c xx/drivers/sound/wavfront.c --- x-ref/drivers/sound/wavfront.c 2003-03-15 03:25:06.000000000 +0100 +++ xx/drivers/sound/wavfront.c 2003-10-02 15:15:49.000000000 +0200 @@ -181,9 +181,9 @@ int wait_polls = 2000; /* This is a numb sleep we wait up to 2.4ms in a loop. */ -int sleep_length = HZ/100; /* This says how long we're going to sleep between polls. - 10ms sounds reasonable for fast response. - */ +int sleep_length = USER_HZ/100; /* This says how long we're going to sleep between polls. + 10ms sounds reasonable for fast response. + */ int sleep_tries = 50; /* Wait for status 0.5 seconds total. */ @@ -434,7 +434,7 @@ wavefront_wait (int mask) } set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(sleep_length); + schedule_timeout(user_to_kernel_hz_overflow(sleep_length)); if (signal_pending(current)) break; } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/drivers/telephony/ixj.c xx/drivers/telephony/ixj.c --- x-ref/drivers/telephony/ixj.c 2003-06-13 22:07:32.000000000 +0200 +++ xx/drivers/telephony/ixj.c 2003-10-02 15:15:49.000000000 +0200 @@ -279,7 +279,8 @@ static char ixj_c_revision[] = "$Revisio #define NUM(dev) (MINOR(dev) & 0xf) static int ixjdebug; -static int hertz = HZ; +static int __hertz = USER_HZ; +#define hertz user_to_kernel_hz_overflow(__hertz) static int samplerate = 100; MODULE_PARM(ixjdebug, "i"); @@ -6426,10 +6427,10 @@ static int ixj_ioctl(struct inode *inode retval = (j->ver.high << 8) + j->ver.low; break; case IXJCTL_HZ: - hertz = arg; + __hertz = arg; break; case IXJCTL_RATE: - if (arg > hertz) + if (arg > __hertz) retval = -1; else samplerate = arg; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/fs/buffer.c xx/fs/buffer.c --- x-ref/fs/buffer.c 2003-10-02 15:15:48.000000000 +0200 +++ xx/fs/buffer.c 2003-10-02 15:15:49.000000000 +0200 @@ -99,11 +99,11 @@ static DECLARE_WAIT_QUEUE_HEAD(kupdate_w /* This is used by some architectures to estimate available memory. */ atomic_t buffermem_pages = ATOMIC_INIT(0); -union bdflush_param bdf_prm = {{50, 500, 0, 0, 5*HZ, 30*HZ, 60, 20, 0}}; +union bdflush_param bdf_prm = {{50, 500, 0, 0, 5*USER_HZ, 30*USER_HZ, 60, 20, 0}}; /* These are the min and max parameter values that we will allow to be assigned */ -int bdflush_min[BDFLUSH_NR_PARAM] = { 0, 1, 0, 0, 0, 1*HZ, 0, 0, 0}; -int bdflush_max[BDFLUSH_NR_PARAM] = {100,50000, 20000, 20000,10000*HZ, 10000*HZ, 100, 100, 0}; +int bdflush_min[BDFLUSH_NR_PARAM] = { 0, 1, 0, 0, 0, 1*USER_HZ, 0, 0, 0}; +int bdflush_max[BDFLUSH_NR_PARAM] = {100,50000, 20000, 20000,10000*USER_HZ, 10000*USER_HZ, 100, 100, 0}; static inline int write_buffer_delay(struct buffer_head *bh) { @@ -1105,7 +1105,7 @@ EXPORT_SYMBOL(balance_dirty); inline void __mark_dirty(struct buffer_head *bh) { - bh->b_flushtime = jiffies + bdf_prm.b_un.age_buffer; + bh->b_flushtime = jiffies + get_buffer_flushtime(); refile_buffer(bh); } @@ -1129,7 +1129,7 @@ void mark_buffer_dirty(struct buffer_hea void set_buffer_flushtime(struct buffer_head *bh) { - bh->b_flushtime = jiffies + bdf_prm.b_un.age_buffer; + bh->b_flushtime = jiffies + get_buffer_flushtime(); } EXPORT_SYMBOL(set_buffer_flushtime); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/fs/proc/array.c xx/fs/proc/array.c --- x-ref/fs/proc/array.c 2003-10-02 15:15:46.000000000 +0200 +++ xx/fs/proc/array.c 2003-10-02 15:15:49.000000000 +0200 @@ -361,15 +361,15 @@ int proc_pid_stat(struct task_struct *ta task->cmin_flt, task->maj_flt, task->cmaj_flt, - task->times.tms_utime, - task->times.tms_stime, - task->times.tms_cutime, - task->times.tms_cstime, + jiffies_to_clock_t(task->times.tms_utime), + jiffies_to_clock_t(task->times.tms_stime), + jiffies_to_clock_t(task->times.tms_cutime), + jiffies_to_clock_t(task->times.tms_cstime), priority, nice, 0UL /* removed */, - task->it_real_value, - task->start_time, + jiffies_to_clock_t(task->it_real_value), + jiffies_to_clock_t(task->start_time), vsize, mm ? mm->rss : 0, /* you might want to shift this left 3 */ task->rlim[RLIMIT_RSS].rlim_cur, @@ -618,14 +618,14 @@ int proc_pid_cpu(struct task_struct *tas len = sprintf(buffer, "cpu %lu %lu\n", - task->times.tms_utime, - task->times.tms_stime); + jiffies_to_clock_t(task->times.tms_utime), + jiffies_to_clock_t(task->times.tms_stime)); for (i = 0 ; i < smp_num_cpus; i++) len += sprintf(buffer + len, "cpu%d %lu %lu\n", i, - task->per_cpu_utime[cpu_logical_map(i)], - task->per_cpu_stime[cpu_logical_map(i)]); + jiffies_to_clock_t(task->per_cpu_utime[cpu_logical_map(i)]), + jiffies_to_clock_t(task->per_cpu_stime[cpu_logical_map(i)])); return len; } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/fs/proc/proc_misc.c xx/fs/proc/proc_misc.c --- x-ref/fs/proc/proc_misc.c 2003-10-02 15:15:46.000000000 +0200 +++ xx/fs/proc/proc_misc.c 2003-10-02 15:15:49.000000000 +0200 @@ -136,19 +136,19 @@ static int uptime_read_proc(char *page, calculations simplify to the version in the #else part (if the printf format is adapted to the same number of digits as zeroes in HZ. */ -#if HZ!=100 - len = sprintf(page,"%lu.%02lu %lu.%02lu\n", - uptime / HZ, - (((uptime % HZ) * 100) / HZ) % 100, - idle / HZ, - (((idle % HZ) * 100) / HZ) % 100); -#else - len = sprintf(page,"%lu.%02lu %lu.%02lu\n", - uptime / HZ, - uptime % HZ, - idle / HZ, - idle % HZ); -#endif + if (HZ != 100) { + len = sprintf(page,"%lu.%02lu %lu.%02lu\n", + uptime / HZ, + (((uptime % HZ) * 100) / HZ) % 100, + idle / HZ, + (((idle % HZ) * 100) / HZ) % 100); + } else { + len = sprintf(page,"%lu.%02lu %lu.%02lu\n", + uptime / HZ, + uptime % HZ, + idle / HZ, + idle % HZ); + } return proc_calc_metrics(page, start, off, count, eof, len); } @@ -407,16 +407,16 @@ static int kstat_read_proc(char *page, c { int i, len = 0; extern unsigned long total_forks; - unsigned long jif = jiffies; + unsigned long jif = jiffies_to_clock_t(jiffies); unsigned int sum = 0, user = 0, nice = 0, system = 0; int major, disk; for (i = 0 ; i < smp_num_cpus; i++) { int cpu = cpu_logical_map(i), j; - user += kstat.per_cpu_user[cpu]; - nice += kstat.per_cpu_nice[cpu]; - system += kstat.per_cpu_system[cpu]; + user += jiffies_to_clock_t(kstat.per_cpu_user[cpu]); + nice += jiffies_to_clock_t(kstat.per_cpu_nice[cpu]); + system += jiffies_to_clock_t(kstat.per_cpu_system[cpu]); #if !defined(CONFIG_ARCH_S390) for (j = 0 ; j < NR_IRQS ; j++) sum += kstat.irqs[cpu][j]; @@ -430,10 +430,10 @@ static int kstat_read_proc(char *page, c proc_sprintf(page, &off, &len, "cpu%d %u %u %u %lu\n", i, - kstat.per_cpu_user[cpu_logical_map(i)], - kstat.per_cpu_nice[cpu_logical_map(i)], - kstat.per_cpu_system[cpu_logical_map(i)], - jif - ( kstat.per_cpu_user[cpu_logical_map(i)] \ + jiffies_to_clock_t(kstat.per_cpu_user[cpu_logical_map(i)]), + jiffies_to_clock_t(kstat.per_cpu_nice[cpu_logical_map(i)]), + jiffies_to_clock_t(kstat.per_cpu_system[cpu_logical_map(i)]), + jif - jiffies_to_clock_t(kstat.per_cpu_user[cpu_logical_map(i)] \ + kstat.per_cpu_nice[cpu_logical_map(i)] \ + kstat.per_cpu_system[cpu_logical_map(i)])); proc_sprintf(page, &off, &len, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/fs/xfs/linux/xfs_globals.c xx/fs/xfs/linux/xfs_globals.c --- x-ref/fs/xfs/linux/xfs_globals.c 2003-10-02 15:15:42.000000000 +0200 +++ xx/fs/xfs/linux/xfs_globals.c 2003-10-02 15:15:49.000000000 +0200 @@ -61,7 +61,7 @@ xfs_param_t xfs_params = { .symlink_mode = { 0, 0, 1 }, .panic_mask = { 0, 0, 127 }, .error_level = { 0, 3, 11 }, - .sync_interval = { HZ, 30*HZ, 60*HZ }, + .__sync_interval = { USER_HZ, 30*USER_HZ, 60*USER_HZ }, .stats_clear = { 0, 0, 1 }, }; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/fs/xfs/linux/xfs_linux.h xx/fs/xfs/linux/xfs_linux.h --- x-ref/fs/xfs/linux/xfs_linux.h 2003-10-02 15:15:42.000000000 +0200 +++ xx/fs/xfs/linux/xfs_linux.h 2003-10-02 15:15:49.000000000 +0200 @@ -108,7 +108,7 @@ static inline void set_buffer_unwritten_ #define irix_symlink_mode xfs_params.symlink_mode.val #define xfs_panic_mask xfs_params.panic_mask.val #define xfs_error_level xfs_params.error_level.val -#define xfs_syncd_interval xfs_params.sync_interval.val +#define xfs_syncd_interval user_to_kernel_hz_overflow(xfs_params.__sync_interval.val) #define xfs_stats_clear xfs_params.stats_clear.val #define NBPP PAGE_SIZE diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/fs/xfs/linux/xfs_sysctl.c xx/fs/xfs/linux/xfs_sysctl.c --- x-ref/fs/xfs/linux/xfs_sysctl.c 2003-10-02 15:15:42.000000000 +0200 +++ xx/fs/xfs/linux/xfs_sysctl.c 2003-10-02 15:15:49.000000000 +0200 @@ -130,10 +130,10 @@ STATIC ctl_table xfs_table[] = { &sysctl_intvec, NULL, &xfs_params.error_level.min, &xfs_params.error_level.max}, - {XFS_SYNC_INTERVAL, "sync_interval", &xfs_params.sync_interval.val, + {XFS_SYNC_INTERVAL, "sync_interval", &xfs_params.__sync_interval.val, sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax, &sysctl_intvec, NULL, - &xfs_params.sync_interval.min, &xfs_params.sync_interval.max}, + &xfs_params.__sync_interval.min, &xfs_params.__sync_interval.max}, /* please keep this the last entry */ #ifdef CONFIG_PROC_FS diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/fs/xfs/linux/xfs_sysctl.h xx/fs/xfs/linux/xfs_sysctl.h --- x-ref/fs/xfs/linux/xfs_sysctl.h 2003-10-02 15:15:42.000000000 +0200 +++ xx/fs/xfs/linux/xfs_sysctl.h 2003-10-02 15:15:49.000000000 +0200 @@ -55,7 +55,7 @@ typedef struct xfs_param { xfs_sysctl_val_t symlink_mode; /* Link creat mode affected by umask */ xfs_sysctl_val_t panic_mask; /* bitmask to cause panic on errors. */ xfs_sysctl_val_t error_level; /* Degree of reporting for problems */ - xfs_sysctl_val_t sync_interval; /* time between sync calls */ + xfs_sysctl_val_t __sync_interval; /* time between sync calls */ xfs_sysctl_val_t stats_clear; /* Reset all XFS statistics to zero. */ } xfs_param_t; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/fs/xfs/pagebuf/page_buf.c xx/fs/xfs/pagebuf/page_buf.c --- x-ref/fs/xfs/pagebuf/page_buf.c 2003-10-02 15:15:42.000000000 +0200 +++ xx/fs/xfs/pagebuf/page_buf.c 2003-10-02 15:15:49.000000000 +0200 @@ -179,8 +179,8 @@ STATIC void pagebuf_delwri_queue(page_bu pagebuf_param_t pb_params = { /* MIN DFLT MAX */ - .flush_interval = { HZ/2, HZ, 30*HZ }, - .age_buffer = { 1*HZ, 15*HZ, 300*HZ }, + .flush_interval = { USER_HZ/2, USER_HZ, 30*USER_HZ }, + .age_buffer = { 1*USER_HZ, 15*USER_HZ, 300*USER_HZ }, .stats_clear = { 0, 0, 1 }, .debug = { 0, 0, 1 }, }; @@ -1895,7 +1895,7 @@ pagebuf_delwri_queue( } list_add_tail(&pb->pb_list, &pbd_delwrite_queue); - pb->pb_flushtime = jiffies + pb_params.age_buffer.val; + pb->pb_flushtime = jiffies + pb_params.age_buffer.val * HZ / USER_HZ; spin_unlock(&pbd_delwrite_lock); if (unlock && (pb->pb_flags & _PBF_LOCKABLE)) { @@ -2050,7 +2050,7 @@ pagebuf_daemon( do { if (pbd_active == 1) { mod_timer(&pb_daemon_timer, - jiffies + pb_params.flush_interval.val); + jiffies + pb_params.flush_interval.val * HZ / USER_HZ); interruptible_sleep_on(&pbd_waitq); } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-alpha/param.h xx/include/asm-alpha/param.h --- x-ref/include/asm-alpha/param.h 2003-03-15 03:25:09.000000000 +0100 +++ xx/include/asm-alpha/param.h 2003-10-02 15:15:49.000000000 +0200 @@ -7,14 +7,20 @@ #include -#ifndef HZ +#ifndef USER_HZ # ifndef CONFIG_ALPHA_RAWHIDE -# define HZ 1024 +# define USER_HZ 1024 # else -# define HZ 1200 +# define USER_HZ 1200 # endif #endif +#define DESKTOP_HZ USER_HZ + +#ifdef __KERNEL__ + +#include + #define EXEC_PAGESIZE 8192 #ifndef NGROUPS @@ -27,8 +33,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#ifdef __KERNEL__ -# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ -#endif - #endif /* _ASM_ALPHA_PARAM_H */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-i386/param.h xx/include/asm-i386/param.h --- x-ref/include/asm-i386/param.h 2003-03-15 03:25:10.000000000 +0100 +++ xx/include/asm-i386/param.h 2003-10-02 15:15:49.000000000 +0200 @@ -1,9 +1,14 @@ #ifndef _ASMi386_PARAM_H #define _ASMi386_PARAM_H -#ifndef HZ -#define HZ 100 -#endif +#ifdef __KERNEL__ + +#define DESKTOP_HZ 1000 +#define USER_HZ 100 /* default (user level) HZ */ + +#include + +#endif /* __KERNEL__ */ #define EXEC_PAGESIZE 4096 @@ -17,8 +22,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#ifdef __KERNEL__ -# define CLOCKS_PER_SEC 100 /* frequency at which times() counts */ -#endif - #endif diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-ia64/param.h xx/include/asm-ia64/param.h --- x-ref/include/asm-ia64/param.h 2003-03-15 03:25:11.000000000 +0100 +++ xx/include/asm-ia64/param.h 2003-10-02 15:15:49.000000000 +0200 @@ -15,11 +15,15 @@ * Yeah, simulating stuff is slow, so let us catch some breath between * timer interrupts... */ -# define HZ 32 +# define USER_HZ 32 #else -# define HZ 1024 +# define USER_HZ 1024 #endif +#define DESKTOP_HZ USER_HZ + +#include + #define EXEC_PAGESIZE 65536 #ifndef NGROUPS @@ -32,8 +36,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#ifdef __KERNEL__ -# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ -#endif - #endif /* _ASM_IA64_PARAM_H */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-ppc/param.h xx/include/asm-ppc/param.h --- x-ref/include/asm-ppc/param.h 2003-06-13 22:07:41.000000000 +0200 +++ xx/include/asm-ppc/param.h 2003-10-02 15:15:49.000000000 +0200 @@ -1,9 +1,14 @@ #ifndef _ASM_PPC_PARAM_H #define _ASM_PPC_PARAM_H -#ifndef HZ -#define HZ 100 -#endif +#ifdef __KERNEL__ + +#define DESKTOP_HZ 1000 +#define USER_HZ 100 /* default (user level) HZ */ + +#include + +#endif /* __KERNEL__ */ #define EXEC_PAGESIZE 4096 @@ -17,8 +22,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#ifdef __KERNEL__ -# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ -#endif /* __KERNEL__ */ - #endif diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-ppc64/param.h xx/include/asm-ppc64/param.h --- x-ref/include/asm-ppc64/param.h 2003-03-15 03:25:16.000000000 +0100 +++ xx/include/asm-ppc64/param.h 2003-10-02 15:15:49.000000000 +0200 @@ -8,6 +8,15 @@ * 2 of the License, or (at your option) any later version. */ +#ifdef __KERNEL__ + +#define DESKTOP_HZ 1000 +#define USER_HZ 100 /* default (user level) HZ */ + +#include + +#endif /* __KERNEL__ */ + #ifndef HZ #define HZ 100 #ifdef __KERNEL__ @@ -34,8 +43,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#ifdef __KERNEL__ -# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ -#endif - #endif /* _ASM_PPC64_PARAM_H */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-s390/param.h xx/include/asm-s390/param.h --- x-ref/include/asm-s390/param.h 2003-03-15 03:25:12.000000000 +0100 +++ xx/include/asm-s390/param.h 2003-10-02 15:15:49.000000000 +0200 @@ -9,9 +9,14 @@ #ifndef _ASMS390_PARAM_H #define _ASMS390_PARAM_H -#ifndef HZ -#define HZ 100 -#endif +#ifdef __KERNEL__ + +#define DESKTOP_HZ 1000 +#define USER_HZ 100 /* default (user level) HZ */ + +#include + +#endif /* __KERNEL__ */ #define EXEC_PAGESIZE 4096 @@ -25,8 +30,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#ifdef __KERNEL__ -# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ -#endif - #endif diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-s390x/param.h xx/include/asm-s390x/param.h --- x-ref/include/asm-s390x/param.h 2003-03-15 03:25:13.000000000 +0100 +++ xx/include/asm-s390x/param.h 2003-10-02 15:15:49.000000000 +0200 @@ -9,6 +9,15 @@ #ifndef _ASMS390_PARAM_H #define _ASMS390_PARAM_H +#ifdef __KERNEL__ + +#define DESKTOP_HZ 1000 +#define USER_HZ 100 /* default (user level) HZ */ + +#include + +#endif /* __KERNEL__ */ + #ifndef HZ #define HZ 100 #ifdef __KERNEL__ @@ -28,8 +37,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#ifdef __KERNEL__ -# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ -#endif - #endif diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-x86_64/param.h xx/include/asm-x86_64/param.h --- x-ref/include/asm-x86_64/param.h 2003-03-15 03:25:16.000000000 +0100 +++ xx/include/asm-x86_64/param.h 2003-10-02 15:15:49.000000000 +0200 @@ -1,8 +1,13 @@ #ifndef _ASMx86_64_PARAM_H #define _ASMx86_64_PARAM_H -#ifndef HZ -#define HZ 100 +#ifdef __KERNEL__ + +#define DESKTOP_HZ 1000 +#define USER_HZ 100 /* default (user level) HZ */ + +#include + #endif #define EXEC_PAGESIZE 4096 @@ -17,8 +22,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#ifdef __KERNEL__ -# define CLOCKS_PER_SEC 100 /* frequency at which times() counts */ -#endif - #endif diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/asm-x86_64/vsyscall.h xx/include/asm-x86_64/vsyscall.h --- x-ref/include/asm-x86_64/vsyscall.h 2003-08-26 00:13:07.000000000 +0200 +++ xx/include/asm-x86_64/vsyscall.h 2003-10-02 15:15:49.000000000 +0200 @@ -21,6 +21,7 @@ enum vsyscall_num { #define __section_sys_tz __attribute__ ((unused, __section__ (".sys_tz"), aligned(16))) #define __section_xtime __attribute__ ((unused, __section__ (".xtime"), aligned(16))) #define __section_vxtime_sequence __attribute__ ((unused, __section__ (".vxtime_sequence"), aligned(16))) +#define __section_HZ __attribute__ ((unused, __section__ (".__HZ"), aligned(16))) struct vxtime_data { long last_tsc; @@ -44,6 +45,7 @@ extern struct timeval __xtime; extern volatile unsigned long __jiffies; extern unsigned long __wall_jiffies; extern struct timezone __sys_tz; +extern unsigned long ____HZ; /* kernel space (writeable) */ extern long vxtime_sequence[2]; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/atalk.h xx/include/linux/atalk.h --- x-ref/include/linux/atalk.h 2003-09-05 02:21:58.000000000 +0200 +++ xx/include/linux/atalk.h 2003-10-02 15:15:49.000000000 +0200 @@ -147,11 +147,11 @@ struct elapaarp __u8 pa_dst_node __attribute__ ((packed)); }; -#define AARP_EXPIRY_TIME (5*60*HZ) /* Not specified - how long till we drop a resolved entry */ +#define AARP_EXPIRY_TIME (5*60*USER_HZ) /* Not specified - how long till we drop a resolved entry */ #define AARP_HASH_SIZE 16 /* Size of hash table */ -#define AARP_TICK_TIME (HZ/5) /* Fast retransmission timer when resolving */ +#define AARP_TICK_TIME (USER_HZ/5) /* Fast retransmission timer when resolving */ #define AARP_RETRANSMIT_LIMIT 10 /* Send 10 requests then give up (2 seconds) */ -#define AARP_RESOLVE_TIME (10*HZ) /* Some value bigger than total retransmit time + a bit for last reply to appear and to stop continual requests */ +#define AARP_RESOLVE_TIME (10*USER_HZ) /* Some value bigger than total retransmit time + a bit for last reply to appear and to stop continual requests */ extern struct datalink_proto *ddp_dl, *aarp_dl; extern void aarp_proto_init(void); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/bdf_prm.h xx/include/linux/bdf_prm.h --- x-ref/include/linux/bdf_prm.h 2003-10-02 15:15:48.000000000 +0200 +++ xx/include/linux/bdf_prm.h 2003-10-02 15:15:49.000000000 +0200 @@ -29,7 +29,7 @@ union bdflush_param { unsigned int data[BDFLUSH_NR_PARAM]; }; extern union bdflush_param bdf_prm; -#define bdflush_interval() (bdf_prm.b_un.interval) -#define get_buffer_flushtime() (bdf_prm.b_un.age_buffer) +#define bdflush_interval() (user_to_kernel_hz_overflow(bdf_prm.b_un.interval)) +#define get_buffer_flushtime() (user_to_kernel_hz_overflow(bdf_prm.b_un.age_buffer)) #endif /* _LINUX_BDF_PRM_H */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/cyclades.h xx/include/linux/cyclades.h --- x-ref/include/linux/cyclades.h 2003-06-13 22:07:42.000000000 +0200 +++ xx/include/linux/cyclades.h 2003-10-02 15:15:49.000000000 +0200 @@ -117,7 +117,7 @@ struct cyclades_idle_stats { #define CZ_BOOT_END (CZIOC|0xfd) #define CZ_TEST (CZIOC|0xfe) -#define CZ_DEF_POLL (HZ/25) +#define CZ_DEF_POLL (USER_HZ/25) #define MAX_BOARD 4 /* Max number of boards */ #define MAX_DEV 256 /* Max number of ports total */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/fd.h xx/include/linux/fd.h --- x-ref/include/linux/fd.h 2003-07-28 03:28:25.000000000 +0200 +++ xx/include/linux/fd.h 2003-10-02 15:15:49.000000000 +0200 @@ -127,15 +127,15 @@ struct floppy_drive_params { * 8" drives) */ unsigned long srt; /* Step rate, usec */ - unsigned long spinup; /* time needed for spinup (expressed + unsigned long __spinup; /* time needed for spinup (expressed * in jiffies) */ - unsigned long spindown; /* timeout needed for spindown */ + unsigned long __spindown; /* timeout needed for spindown */ unsigned char spindown_offset; /* decides in which position the disk * will stop */ - unsigned char select_delay; /* delay to wait after select */ + unsigned char __select_delay; /* delay to wait after select */ unsigned char rps; /* rotations per second */ unsigned char tracks; /* maximum number of tracks */ - unsigned long timeout; /* timeout for interrupt requests */ + unsigned long __timeout; /* timeout for interrupt requests */ unsigned char interleave_sect; /* if there are more sectors, use * interleave */ @@ -165,7 +165,7 @@ struct floppy_drive_params { */ short autodetect[8]; /* autodetected formats */ - int checkfreq; /* how often should the drive be checked for disk + int __checkfreq; /* how often should the drive be checked for disk * changes */ int native_format; /* native format of this drive */ }; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/hz.h xx/include/linux/hz.h --- x-ref/include/linux/hz.h 1970-01-01 01:00:00.000000000 +0100 +++ xx/include/linux/hz.h 2003-10-02 15:15:49.000000000 +0200 @@ -0,0 +1,34 @@ +#ifndef _LINUX_HZ_H +#define _LINUX_HZ_H + +#include +#include + +extern unsigned long __HZ; + +static inline unsigned long get_hz(void) +{ +#ifdef CONFIG_DEBUG_HZ + if (unlikely(!__HZ)) { + __label__ here; + printk("early HZ: %p\n", &&here); + here: + init_HZ(USER_HZ); + } +#endif /* CONFIG_DEBUG_HZ */ + return __HZ; +} + +#define HZ get_hz() + +#define CLOCKS_PER_SEC (USER_HZ) /* like times() */ + +#define jiffies_to_clock_t(x) (likely((HZ) >= (USER_HZ)) ? \ + (x + ((HZ) / (USER_HZ)) - 1) / ((HZ) / (USER_HZ)) : \ + (x) * ((USER_HZ) / (HZ))) +#define user_to_kernel_hz(x) (likely((HZ) >= (USER_HZ)) ? \ + (x) * ((HZ) / (USER_HZ)) : \ + (x + ((USER_HZ) / (HZ)) - 1) / ((USER_HZ) / (HZ))) +#define user_to_kernel_hz_overflow(x) ((x + USER_HZ - 1) * (HZ) / (USER_HZ)) + +#endif /* _LINUX_HZ_H */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/ipv6.h xx/include/linux/ipv6.h --- x-ref/include/linux/ipv6.h 2003-10-02 00:09:47.000000000 +0200 +++ xx/include/linux/ipv6.h 2003-10-02 15:15:49.000000000 +0200 @@ -112,8 +112,8 @@ struct ipv6_devconf { __s32 autoconf; __s32 dad_transmits; __s32 rtr_solicits; - __s32 rtr_solicit_interval; - __s32 rtr_solicit_delay; + __s32 __rtr_solicit_interval; + __s32 __rtr_solicit_delay; #ifdef CONFIG_IPV6_PRIVACY __s32 use_tempaddr; __s32 temp_valid_lft; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/sched.h xx/include/linux/sched.h --- x-ref/include/linux/sched.h 2003-10-02 15:15:48.000000000 +0200 +++ xx/include/linux/sched.h 2003-10-02 15:15:49.000000000 +0200 @@ -6,6 +6,7 @@ extern unsigned long event; #include +#include #include #include #include @@ -528,7 +529,7 @@ extern struct exec_domain default_exec_d active_mm: &init_mm, \ cpus_allowed: ~0UL, \ run_list: LIST_HEAD_INIT(tsk.run_list), \ - time_slice: HZ, \ + time_slice: 1, \ next_task: &tsk, \ prev_task: &tsk, \ p_opptr: &tsk, \ @@ -1017,6 +1018,9 @@ static inline void schedule(void) } #endif +extern void __init init_HZ(unsigned long); +extern void __init init_desktop(void); + #endif /* __KERNEL__ */ #endif diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/sysctl.h xx/include/linux/sysctl.h --- x-ref/include/linux/sysctl.h 2003-10-02 15:15:48.000000000 +0200 +++ xx/include/linux/sysctl.h 2003-10-02 15:15:49.000000000 +0200 @@ -134,6 +134,7 @@ enum KERN_SCHED_YIELD_SCALE=61, /* int: select between scalable or interactive */ KERN_MAXTIMESLICE=62, /* int: nice -20 max timeslice */ KERN_MINTIMESLICE=63, /* int: nice +19 min timeslice */ + KERN_HZ=64, /* unsigned long: interal kernel HZ */ }; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/timex.h xx/include/linux/timex.h --- x-ref/include/linux/timex.h 2003-09-02 03:42:57.000000000 +0200 +++ xx/include/linux/timex.h 2003-10-02 15:15:49.000000000 +0200 @@ -60,23 +60,22 @@ * OSF/1 kernel. The SHIFT_HZ define expresses the same value as the * nearest power of two in order to avoid hardware multiply operations. */ -#if HZ >= 12 && HZ < 24 -# define SHIFT_HZ 4 -#elif HZ >= 24 && HZ < 48 -# define SHIFT_HZ 5 -#elif HZ >= 48 && HZ < 96 -# define SHIFT_HZ 6 -#elif HZ >= 96 && HZ < 192 -# define SHIFT_HZ 7 -#elif HZ >= 192 && HZ < 384 -# define SHIFT_HZ 8 -#elif HZ >= 384 && HZ < 768 -# define SHIFT_HZ 9 -#elif HZ >= 768 && HZ < 1536 -# define SHIFT_HZ 10 -#else -# error You lose. -#endif +extern unsigned long __SHIFT_HZ; + +#ifdef CONFIG_DEBUG_HZ +static inline unsigned long get_shift_hz(void) +{ + if (unlikely(!__SHIFT_HZ)) { + __label__ here; + printk("early SHIFT_HZ: %p\n", &&here); + here:; + } + return __SHIFT_HZ; +} +#define SHIFT_HZ get_shift_hz() +#else /* CONFIG_DEBUG_HZ */ +#define SHIFT_HZ __SHIFT_HZ +#endif /* CONFIG_DEBUG_HZ */ /* * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen @@ -250,8 +249,23 @@ struct timex { * Note: maximum error = NTP synch distance = dispersion + delay / 2; * estimated error = NTP dispersion. */ -extern long tick; /* timer interrupt period */ -extern int tickadj; /* amount of adjustment per tick */ +extern long __tick; /* timer interrupt period */ +#ifdef CONFIG_DEBUG_HZ +static inline unsigned long get_tick(void) +{ + if (unlikely(!__tick)) { + __label__ here; + printk("early tick: %p\n", &&here); + here:; + } + return __tick; +} +#else /* CONFIG_DEBUG_HZ */ +#define get_tick() __tick +#endif /* CONFIG_DEBUG_HZ */ + +/* Don't completely fail for HZ > 500. */ +#define tickadj (500/HZ ? : 1) /* microsecs */ /* * phase-lock loop variables @@ -266,7 +280,8 @@ extern long time_maxerror; /* maximum er extern long time_esterror; /* estimated error */ extern long time_phase; /* phase offset (scaled us) */ -extern long time_freq; /* frequency offset (scaled ppm) */ +extern long __time_freq; /* frequency offset (scaled ppm) */ +#define get_time_freq() __time_freq extern long time_adj; /* tick adjust (scaled 1 / HZ) */ extern long time_reftime; /* time at last adjustment (s) */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/addrconf.h xx/include/net/addrconf.h --- x-ref/include/net/addrconf.h 2003-09-02 03:46:02.000000000 +0200 +++ xx/include/net/addrconf.h 2003-10-02 15:15:49.000000000 +0200 @@ -4,7 +4,7 @@ #define RETRANS_TIMER HZ #define MAX_RTR_SOLICITATIONS 3 -#define RTR_SOLICITATION_INTERVAL (4*HZ) +#define RTR_SOLICITATION_INTERVAL (4*USER_HZ) #define ADDR_CHECK_FREQUENCY (120*HZ) diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/ax25.h xx/include/net/ax25.h --- x-ref/include/net/ax25.h 2003-09-05 02:21:58.000000000 +0200 +++ xx/include/net/ax25.h 2003-10-02 15:15:49.000000000 +0200 @@ -123,14 +123,14 @@ enum { #define AX25_DEF_CONMODE 2 /* Connected mode allowed */ #define AX25_DEF_WINDOW 2 /* Window=2 */ #define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */ -#define AX25_DEF_T1 (10 * HZ) /* T1=10s */ -#define AX25_DEF_T2 (3 * HZ) /* T2=3s */ -#define AX25_DEF_T3 (300 * HZ) /* T3=300s */ +#define AX25_DEF_T1 (10 * USER_HZ) /* T1=10s */ +#define AX25_DEF_T2 (3 * USER_HZ) /* T2=3s */ +#define AX25_DEF_T3 (300 * USER_HZ) /* T3=300s */ #define AX25_DEF_N2 10 /* N2=10 */ -#define AX25_DEF_IDLE (0 * 60 * HZ) /* Idle=None */ +#define AX25_DEF_IDLE (0 * 60 * USER_HZ) /* Idle=None */ #define AX25_DEF_PACLEN 256 /* Paclen=256 */ #define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */ -#define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ +#define AX25_DEF_DS_TIMEOUT (3 * 60 * USER_HZ) /* DAMA timeout 3 minutes */ typedef struct ax25_uid_assoc { struct ax25_uid_assoc *next; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/ip.h xx/include/net/ip.h --- x-ref/include/net/ip.h 2003-10-02 15:15:31.000000000 +0200 +++ xx/include/net/ip.h 2003-10-02 15:15:49.000000000 +0200 @@ -73,7 +73,7 @@ extern rwlock_t ip_ra_lock; #define IP_MF 0x2000 /* Flag: "More Fragments" */ #define IP_OFFSET 0x1FFF /* "Fragment Offset" part */ -#define IP_FRAG_TIME (30 * HZ) /* fragment lifetime */ +#define IP_FRAG_TIME (30 * USER_HZ) /* fragment lifetime */ extern void ip_mc_dropsocket(struct sock *); extern void ip_mc_dropdevice(struct net_device *dev); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/ip6_route.h xx/include/net/ip6_route.h --- x-ref/include/net/ip6_route.h 2003-09-02 03:46:01.000000000 +0200 +++ xx/include/net/ip6_route.h 2003-10-02 15:15:49.000000000 +0200 @@ -24,7 +24,8 @@ extern struct rt6_info ip6_null_entry; extern int ip6_rt_max_size; extern int ip6_rt_gc_min; extern int ip6_rt_gc_timeout; -extern int ip6_rt_gc_interval; +extern int __ip6_rt_gc_interval; +#define ip6_rt_gc_interval user_to_kernel_hz_overflow(__ip6_rt_gc_interval) extern void ip6_route_input(struct sk_buff *skb); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/ipv6.h xx/include/net/ipv6.h --- x-ref/include/net/ipv6.h 2003-10-02 00:09:47.000000000 +0200 +++ xx/include/net/ipv6.h 2003-10-02 15:15:49.000000000 +0200 @@ -209,7 +209,7 @@ extern struct ipv6_txoptions * ipv6_dup extern int ip6_frag_nqueues; extern atomic_t ip6_frag_mem; -#define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ +#define IPV6_FRAG_TIMEOUT (60*USER_HZ) /* 60 seconds */ /* * Function prototype for build_xmit diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/irda/irlmp.h xx/include/net/irda/irlmp.h --- x-ref/include/net/irda/irlmp.h 2003-07-20 18:40:14.000000000 +0200 +++ xx/include/net/irda/irlmp.h 2003-10-02 15:15:49.000000000 +0200 @@ -55,7 +55,7 @@ #define LM_MAX_CONNECTIONS 10 -#define LM_IDLE_TIMEOUT 2*HZ /* 2 seconds for now */ +#define LM_IDLE_TIMEOUT 2 /* 2 seconds for now */ typedef enum { S_PNP, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/irda/timer.h xx/include/net/irda/timer.h --- x-ref/include/net/irda/timer.h 2003-07-20 18:40:14.000000000 +0200 +++ xx/include/net/irda/timer.h 2003-10-02 15:15:49.000000000 +0200 @@ -57,7 +57,7 @@ * suggested to 75-85 msec by IrDA lite. This doesn't work with a lot of * devices, and other stackes uses a lot more, so it's best we do it as well */ -#define SLOT_TIMEOUT (90*HZ/1000) +#define SLOT_TIMEOUT (90) /* * We set the query timeout to 100 ms and then expect the value to be diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/ndisc.h xx/include/net/ndisc.h --- x-ref/include/net/ndisc.h 2003-09-02 03:45:23.000000000 +0200 +++ xx/include/net/ndisc.h 2003-10-02 15:15:49.000000000 +0200 @@ -21,7 +21,7 @@ #define ND_OPT_REDIRECT_HDR 4 #define ND_OPT_MTU 5 -#define MAX_RTR_SOLICITATION_DELAY HZ +#define MAX_RTR_SOLICITATION_DELAY USER_HZ #define ND_REACHABLE_TIME (30*HZ) #define ND_RETRANS_TIMER HZ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/netrom.h xx/include/net/netrom.h --- x-ref/include/net/netrom.h 2003-03-15 03:25:16.000000000 +0100 +++ xx/include/net/netrom.h 2003-10-02 15:15:49.000000000 +0200 @@ -38,11 +38,11 @@ enum { #define NR_COND_PEER_RX_BUSY 0x04 #define NR_COND_OWN_RX_BUSY 0x08 -#define NR_DEFAULT_T1 (120 * HZ) /* Outstanding frames - 120 seconds */ -#define NR_DEFAULT_T2 (5 * HZ) /* Response delay - 5 seconds */ +#define NR_DEFAULT_T1 (120 * USER_HZ) /* Outstanding frames - 120 seconds */ +#define NR_DEFAULT_T2 (5 * USER_HZ) /* Response delay - 5 seconds */ #define NR_DEFAULT_N2 3 /* Number of Retries - 3 */ -#define NR_DEFAULT_T4 (180 * HZ) /* Busy Delay - 180 seconds */ -#define NR_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ +#define NR_DEFAULT_T4 (180 * USER_HZ) /* Busy Delay - 180 seconds */ +#define NR_DEFAULT_IDLE (0 * 60 * USER_HZ) /* No Activity Timeout - none */ #define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */ #define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */ #define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */ @@ -106,12 +106,12 @@ struct nr_node { extern int sysctl_netrom_default_path_quality; extern int sysctl_netrom_obsolescence_count_initialiser; extern int sysctl_netrom_network_ttl_initialiser; -extern int sysctl_netrom_transport_timeout; +extern int __sysctl_netrom_transport_timeout; extern int sysctl_netrom_transport_maximum_tries; -extern int sysctl_netrom_transport_acknowledge_delay; -extern int sysctl_netrom_transport_busy_delay; +extern int __sysctl_netrom_transport_acknowledge_delay; +extern int __sysctl_netrom_transport_busy_delay; extern int sysctl_netrom_transport_requested_window_size; -extern int sysctl_netrom_transport_no_activity_timeout; +extern int __sysctl_netrom_transport_no_activity_timeout; extern int sysctl_netrom_routing_control; extern int sysctl_netrom_link_fails_count; extern int nr_rx_frame(struct sk_buff *, struct net_device *); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/pkt_sched.h xx/include/net/pkt_sched.h --- x-ref/include/net/pkt_sched.h 2003-10-02 00:09:47.000000000 +0200 +++ xx/include/net/pkt_sched.h 2003-10-02 15:15:49.000000000 +0200 @@ -212,17 +212,15 @@ extern psched_time_t psched_time_base; #if PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES -#if HZ < 96 -#define PSCHED_JSCALE 14 -#elif HZ >= 96 && HZ < 192 -#define PSCHED_JSCALE 13 -#elif HZ >= 192 && HZ < 384 -#define PSCHED_JSCALE 12 -#elif HZ >= 384 && HZ < 768 -#define PSCHED_JSCALE 11 -#elif HZ >= 768 -#define PSCHED_JSCALE 10 -#endif +static inline int PSCHED_JSCALE(void) +{ + if (HZ == 100) + return 13; + else if (HZ == 1000 || HZ == 1024) + return 10; + else + return 0; +} #define PSCHED_EXPORTLIST_2 @@ -232,20 +230,20 @@ extern psched_time_t psched_time_base; extern PSCHED_WATCHER psched_time_mark; -#define PSCHED_GET_TIME(stamp) ((stamp) = psched_time_base + (((unsigned long)(jiffies-psched_time_mark))<>PSCHED_JSCALE) +#define PSCHED_US2JIFFIE(delay) (((delay)+(1<>PSCHED_JSCALE()) #elif PSCHED_CLOCK_SOURCE == PSCHED_CPU diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/rose.h xx/include/net/rose.h --- x-ref/include/net/rose.h 2003-03-15 03:25:16.000000000 +0100 +++ xx/include/net/rose.h 2003-10-02 15:15:49.000000000 +0200 @@ -47,14 +47,14 @@ enum { ROSE_STATE_5 /* Deferred Call Acceptance */ }; -#define ROSE_DEFAULT_T0 (180 * HZ) /* Default T10 T20 value */ -#define ROSE_DEFAULT_T1 (200 * HZ) /* Default T11 T21 value */ -#define ROSE_DEFAULT_T2 (180 * HZ) /* Default T12 T22 value */ -#define ROSE_DEFAULT_T3 (180 * HZ) /* Default T13 T23 value */ -#define ROSE_DEFAULT_HB (5 * HZ) /* Default Holdback value */ -#define ROSE_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ +#define ROSE_DEFAULT_T0 (180 * USER_HZ) /* Default T10 T20 value */ +#define ROSE_DEFAULT_T1 (200 * USER_HZ) /* Default T11 T21 value */ +#define ROSE_DEFAULT_T2 (180 * USER_HZ) /* Default T12 T22 value */ +#define ROSE_DEFAULT_T3 (180 * USER_HZ) /* Default T13 T23 value */ +#define ROSE_DEFAULT_HB (5 * USER_HZ) /* Default Holdback value */ +#define ROSE_DEFAULT_IDLE (0 * 60 * USER_HZ) /* No Activity Timeout - none */ #define ROSE_DEFAULT_ROUTING 1 /* Default routing flag */ -#define ROSE_DEFAULT_FAIL_TIMEOUT (120 * HZ) /* Time until link considered usable */ +#define ROSE_DEFAULT_FAIL_TIMEOUT (120 * USER_HZ) /* Time until link considered usable */ #define ROSE_DEFAULT_MAXVC 50 /* Maximum number of VCs per neighbour */ #define ROSE_DEFAULT_WINDOW_SIZE 7 /* Default window size */ @@ -140,16 +140,25 @@ typedef struct { /* af_rose.c */ extern ax25_address rose_callsign; -extern int sysctl_rose_restart_request_timeout; -extern int sysctl_rose_call_request_timeout; -extern int sysctl_rose_reset_request_timeout; -extern int sysctl_rose_clear_request_timeout; -extern int sysctl_rose_no_activity_timeout; -extern int sysctl_rose_ack_hold_back_timeout; +extern int __sysctl_rose_restart_request_timeout; +extern int __sysctl_rose_call_request_timeout; +extern int __sysctl_rose_reset_request_timeout; +extern int __sysctl_rose_clear_request_timeout; +extern int __sysctl_rose_no_activity_timeout; +extern int __sysctl_rose_ack_hold_back_timeout; extern int sysctl_rose_routing_control; -extern int sysctl_rose_link_fail_timeout; +extern int __sysctl_rose_link_fail_timeout; extern int sysctl_rose_maximum_vcs; extern int sysctl_rose_window_size; + +#define sysctl_rose_restart_request_timeout user_to_kernel_hz_overflow(__sysctl_rose_restart_request_timeout) +#define sysctl_rose_call_request_timeout user_to_kernel_hz_overflow(__sysctl_rose_call_request_timeout) +#define sysctl_rose_reset_request_timeout user_to_kernel_hz_overflow(__sysctl_rose_reset_request_timeout) +#define sysctl_rose_clear_request_timeout user_to_kernel_hz_overflow(__sysctl_rose_clear_request_timeout) +#define sysctl_rose_no_activity_timeout user_to_kernel_hz_overflow(__sysctl_rose_no_activity_timeout) +#define sysctl_rose_ack_hold_back_timeout user_to_kernel_hz_overflow(__sysctl_rose_ack_hold_back_timeout) +#define sysctl_rose_link_fail_timeout user_to_kernel_hz_overflow(__sysctl_rose_link_fail_timeout) + extern int rosecmp(rose_address *, rose_address *); extern int rosecmpm(rose_address *, rose_address *, unsigned short); extern char *rose2asc(rose_address *); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/tcp.h xx/include/net/tcp.h --- x-ref/include/net/tcp.h 2003-10-02 15:15:40.000000000 +0200 +++ xx/include/net/tcp.h 2003-10-02 15:15:49.000000000 +0200 @@ -317,7 +317,7 @@ static __inline__ int tcp_sk_listen_hash #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT * state, about 60 seconds */ -#define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN +#define TCP_FIN_TIMEOUT (60*USER_HZ) /* BSD style FIN_WAIT2 deadlock breaker. * It used to be 3min, new value is 60sec, * to combine FIN-WAIT-2 timeout with @@ -325,13 +325,8 @@ static __inline__ int tcp_sk_listen_hash */ #define TCP_DELACK_MAX ((unsigned)(HZ/5)) /* maximal time to delay before sending an ACK */ -#if HZ >= 100 -#define TCP_DELACK_MIN ((unsigned)(HZ/25)) /* minimal time to delay before sending an ACK */ -#define TCP_ATO_MIN ((unsigned)(HZ/25)) -#else -#define TCP_DELACK_MIN 4U -#define TCP_ATO_MIN 4U -#endif +#define TCP_DELACK_MIN (HZ >= 100 ? (unsigned)(HZ/25) : 4U) /* minimal time to delay before sending an ACK */ +#define TCP_ATO_MIN (HZ >= 100 ? (unsigned)(HZ/25) : 4U) #define TCP_RTO_MAX ((unsigned)(120*HZ)) #define TCP_RTO_MIN ((unsigned)(HZ/5)) #define TCP_TIMEOUT_INIT ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value */ @@ -340,9 +335,9 @@ static __inline__ int tcp_sk_listen_hash * for local resources. */ -#define TCP_KEEPALIVE_TIME (120*60*HZ) /* two hours */ +#define TCP_KEEPALIVE_TIME (120*60*USER_HZ) /* two hours */ #define TCP_KEEPALIVE_PROBES 9 /* Max of 9 keepalive probes */ -#define TCP_KEEPALIVE_INTVL (75*HZ) +#define TCP_KEEPALIVE_INTVL (75*USER_HZ) #define MAX_TCP_KEEPIDLE 32767 #define MAX_TCP_KEEPINTVL 32767 @@ -375,25 +370,28 @@ 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 -#elif HZ <= 32 -# define TCP_TW_RECYCLE_TICK (5+2-TCP_TW_RECYCLE_SLOTS_LOG) -#elif HZ <= 64 -# define TCP_TW_RECYCLE_TICK (6+2-TCP_TW_RECYCLE_SLOTS_LOG) -#elif HZ <= 128 -# define TCP_TW_RECYCLE_TICK (7+2-TCP_TW_RECYCLE_SLOTS_LOG) -#elif HZ <= 256 -# define TCP_TW_RECYCLE_TICK (8+2-TCP_TW_RECYCLE_SLOTS_LOG) -#elif HZ <= 512 -# define TCP_TW_RECYCLE_TICK (9+2-TCP_TW_RECYCLE_SLOTS_LOG) -#elif HZ <= 1024 -# 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 -# define TCP_TW_RECYCLE_TICK (12+2-TCP_TW_RECYCLE_SLOTS_LOG) -#endif +static inline int TCP_TW_RECYCLE_TICK(void) +{ + if (HZ > 64 && HZ <= 128) + return 7+2-TCP_TW_RECYCLE_SLOTS_LOG; + else if (HZ > 512 && HZ <= 1024) + return 10+2-TCP_TW_RECYCLE_SLOTS_LOG; + else if (unlikely(HZ <= 16 || HZ > 4096)) { + printk("TCP_TW_RECYCLE_TICK wrong HZ"); + return 0; + } else if (HZ <= 32) + return 5+2-TCP_TW_RECYCLE_SLOTS_LOG; + else if (HZ <= 64) + return 6+2-TCP_TW_RECYCLE_SLOTS_LOG; + else if (HZ <= 256) + return 8+2-TCP_TW_RECYCLE_SLOTS_LOG; + else if (HZ <= 512) + return 9+2-TCP_TW_RECYCLE_SLOTS_LOG; + else if (HZ <= 2048) + return 11+2-TCP_TW_RECYCLE_SLOTS_LOG; + else + return 12+2-TCP_TW_RECYCLE_SLOTS_LOG; +} /* * TCP option @@ -434,11 +432,14 @@ extern int sysctl_max_syn_backlog; extern int sysctl_tcp_timestamps; extern int sysctl_tcp_window_scaling; extern int sysctl_tcp_sack; -extern int sysctl_tcp_fin_timeout; +#define sysctl_tcp_fin_timeout user_to_kernel_hz_overflow(__sysctl_tcp_fin_timeout) +extern int __sysctl_tcp_fin_timeout; extern int sysctl_tcp_tw_recycle; -extern int sysctl_tcp_keepalive_time; +#define sysctl_tcp_keepalive_time user_to_kernel_hz_overflow(__sysctl_tcp_keepalive_time) +extern int __sysctl_tcp_keepalive_time; extern int sysctl_tcp_keepalive_probes; -extern int sysctl_tcp_keepalive_intvl; +#define sysctl_tcp_keepalive_intvl user_to_kernel_hz_overflow(__sysctl_tcp_keepalive_intvl) +extern int __sysctl_tcp_keepalive_intvl; extern int sysctl_tcp_syn_retries; extern int sysctl_tcp_synack_retries; extern int sysctl_tcp_retries1; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/net/x25.h xx/include/net/x25.h --- x-ref/include/net/x25.h 2003-03-15 03:25:16.000000000 +0100 +++ xx/include/net/x25.h 2003-10-02 15:15:49.000000000 +0200 @@ -68,11 +68,11 @@ enum { X25_LINK_STATE_3 }; -#define X25_DEFAULT_T20 (180 * HZ) /* Default T20 value */ -#define X25_DEFAULT_T21 (200 * HZ) /* Default T21 value */ -#define X25_DEFAULT_T22 (180 * HZ) /* Default T22 value */ -#define X25_DEFAULT_T23 (180 * HZ) /* Default T23 value */ -#define X25_DEFAULT_T2 (3 * HZ) /* Default ack holdback value */ +#define X25_DEFAULT_T20 (180 * USER_HZ) /* Default T20 value */ +#define X25_DEFAULT_T21 (200 * USER_HZ) /* Default T21 value */ +#define X25_DEFAULT_T22 (180 * USER_HZ) /* Default T22 value */ +#define X25_DEFAULT_T23 (180 * USER_HZ) /* Default T23 value */ +#define X25_DEFAULT_T2 (3 * USER_HZ) /* Default ack holdback value */ #define X25_DEFAULT_WINDOW_SIZE 2 /* Default Window Size */ #define X25_DEFAULT_PACKET_SIZE X25_PS128 /* Default Packet Size */ @@ -140,11 +140,17 @@ typedef struct { } x25_cb; /* af_x25.c */ -extern int sysctl_x25_restart_request_timeout; -extern int sysctl_x25_call_request_timeout; -extern int sysctl_x25_reset_request_timeout; -extern int sysctl_x25_clear_request_timeout; -extern int sysctl_x25_ack_holdback_timeout; +extern int __sysctl_x25_restart_request_timeout; +extern int __sysctl_x25_call_request_timeout; +extern int __sysctl_x25_reset_request_timeout; +extern int __sysctl_x25_clear_request_timeout; +extern int __sysctl_x25_ack_holdback_timeout; + +#define sysctl_x25_restart_request_timeout user_to_kernel_hz_overflow(__sysctl_x25_restart_request_timeout) +#define sysctl_x25_call_request_timeout user_to_kernel_hz_overflow(__sysctl_x25_call_request_timeout) +#define sysctl_x25_reset_request_timeout user_to_kernel_hz_overflow(__sysctl_x25_reset_request_timeout) +#define sysctl_x25_clear_request_timeout user_to_kernel_hz_overflow(__sysctl_x25_clear_request_timeout) +#define sysctl_x25_ack_holdback_timeout user_to_kernel_hz_overflow(__sysctl_x25_ack_holdback_timeout) extern int x25_addr_ntoa(unsigned char *, x25_address *, x25_address *); extern int x25_addr_aton(unsigned char *, x25_address *, x25_address *); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/init/main.c xx/init/main.c --- x-ref/init/main.c 2003-10-02 15:15:46.000000000 +0200 +++ xx/init/main.c 2003-10-02 15:15:49.000000000 +0200 @@ -361,6 +361,7 @@ asmlinkage void __init start_kernel(void lock_kernel(); printk(linux_banner); setup_arch(&command_line); + init_HZ(USER_HZ); build_all_zonelists(); printk("Kernel command line: %s\n", saved_command_line); parse_options(command_line); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/kernel/ksyms.c xx/kernel/ksyms.c --- x-ref/kernel/ksyms.c 2003-10-02 15:15:47.000000000 +0200 +++ xx/kernel/ksyms.c 2003-10-02 15:15:49.000000000 +0200 @@ -511,6 +511,8 @@ EXPORT_SYMBOL(jiffies); EXPORT_SYMBOL(xtime); EXPORT_SYMBOL(do_gettimeofday); EXPORT_SYMBOL(do_settimeofday); +EXPORT_SYMBOL(__HZ); +EXPORT_SYMBOL(__SHIFT_HZ); #if !defined(__ia64__) EXPORT_SYMBOL(loops_per_jiffy); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/kernel/sched.c xx/kernel/sched.c --- x-ref/kernel/sched.c 2003-10-02 15:15:48.000000000 +0200 +++ xx/kernel/sched.c 2003-10-02 15:15:49.000000000 +0200 @@ -45,6 +45,8 @@ #define TASK_USER_PRIO(p) USER_PRIO((p)->static_prio) #define MAX_USER_PRIO (USER_PRIO(MAX_PRIO)) +unsigned long __HZ, __SHIFT_HZ; + /* * These are the 'tuning knobs' of the scheduler: * @@ -2007,3 +2009,58 @@ void __init migration_init(void) } #endif /* CONFIG_SMP */ + +static void __init init_SHIFT_HZ(void) +{ + if (HZ >= 12 && HZ < 24) + __SHIFT_HZ = 4; + else if (HZ >= 24 && HZ < 48) + __SHIFT_HZ = 5; + else if (HZ >= 48 && HZ < 96) + __SHIFT_HZ = 6; + else if (HZ >= 96 && HZ < 192) + __SHIFT_HZ = 7; + else if (HZ >= 192 && HZ < 384) + __SHIFT_HZ = 8; + else if (HZ >= 384 && HZ < 768) + __SHIFT_HZ = 9; + else if (HZ >= 768 && HZ < 1536) + __SHIFT_HZ = 10; + else + printk("SHIFT_HZ setting failure\n"); +} + +void __init init_HZ(unsigned long hz) +{ + if (__HZ) + return; + +#ifdef CONFIG_NET_ESTIMATOR + hz &= ~3UL; +#endif + + if (hz > USER_HZ) { + if (hz % USER_HZ) { + printk("HZ must be a multiple of %lu, using USER_HZ\n", USER_HZ); + return; + } + } else if (hz < USER_HZ) { + if (USER_HZ % hz) { + printk("HZ must be a divisor of %lu, using USER_HZ\n", USER_HZ); + return; + } + } + + __HZ = hz; + init_SHIFT_HZ(); + + __tick = (1000000 + HZ/2) / HZ; + __time_freq = ((1000000 + HZ/2) % HZ - HZ/2) << SHIFT_USEC; +} + +void __init init_desktop(void) +{ + init_HZ(DESKTOP_HZ); + max_timeslice = __MAX_TIMESLICE_DESKTOP; + min_timeslice = __MIN_TIMESLICE_DESKTOP; +} diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/kernel/signal.c xx/kernel/signal.c --- x-ref/kernel/signal.c 2003-10-02 15:15:35.000000000 +0200 +++ xx/kernel/signal.c 2003-10-02 15:15:49.000000000 +0200 @@ -14,6 +14,7 @@ #include #include +#include #include /* @@ -761,8 +762,8 @@ void do_notify_parent(struct task_struct info.si_uid = tsk->uid; /* FIXME: find out whether or not this is supposed to be c*time. */ - info.si_utime = tsk->times.tms_utime; - info.si_stime = tsk->times.tms_stime; + info.si_utime = jiffies_to_clock_t(tsk->times.tms_utime); + info.si_stime = jiffies_to_clock_t(tsk->times.tms_stime); status = tsk->exit_code & 0x7f; why = SI_KERNEL; /* shouldn't happen */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/kernel/sys.c xx/kernel/sys.c --- x-ref/kernel/sys.c 2003-10-02 15:15:47.000000000 +0200 +++ xx/kernel/sys.c 2003-10-02 15:15:49.000000000 +0200 @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -860,16 +861,23 @@ asmlinkage long sys_setfsgid(gid_t gid) asmlinkage long sys_times(struct tms * tbuf) { + struct tms temp; + /* * In the SMP world we might just be unlucky and have one of * the times increment as we use it. Since the value is an * atomically safe type this is just fine. Conceptually its * as if the syscall took an instant longer to occur. */ - if (tbuf) - if (copy_to_user(tbuf, ¤t->times, sizeof(struct tms))) + if (tbuf) { + temp.tms_utime = jiffies_to_clock_t(current->times.tms_utime); + temp.tms_stime = jiffies_to_clock_t(current->times.tms_stime); + temp.tms_cutime = jiffies_to_clock_t(current->times.tms_cutime); + temp.tms_cstime = jiffies_to_clock_t(current->times.tms_cstime); + if (copy_to_user(tbuf, &temp, sizeof(struct tms))) return -EFAULT; - return jiffies; + } + return jiffies_to_clock_t(jiffies); } /* diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/kernel/sysctl.c xx/kernel/sysctl.c --- x-ref/kernel/sysctl.c 2003-10-02 15:15:48.000000000 +0200 +++ xx/kernel/sysctl.c 2003-10-02 15:15:49.000000000 +0200 @@ -296,6 +296,8 @@ static ctl_table kern_table[] = { &max_timeslice,sizeof(int),0644,NULL,&proc_dointvec}, {KERN_MINTIMESLICE, "min-timeslice", &min_timeslice,sizeof(int),0644,NULL,&proc_dointvec}, + {KERN_HZ, "HZ", + &__HZ, sizeof(unsigned long),0444,NULL,&proc_doulongvec_minmax}, {0} }; @@ -1475,7 +1477,7 @@ int sysctl_jiffies(ctl_table *table, int if (olen!=sizeof(int)) return -EINVAL; } - if (put_user(*(int *)(table->data) / HZ, (int *)oldval) || + if (put_user(*(int *)(table->data) / USER_HZ, (int *)oldval) || (oldlenp && put_user(sizeof(int),oldlenp))) return -EFAULT; } @@ -1485,7 +1487,7 @@ int sysctl_jiffies(ctl_table *table, int return -EINVAL; if (get_user(new, (int *)newval)) return -EFAULT; - *(int *)(table->data) = new*HZ; + *(int *)(table->data) = new*USER_HZ; } return 1; } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/kernel/time.c xx/kernel/time.c --- x-ref/kernel/time.c 2003-10-02 15:15:46.000000000 +0200 +++ xx/kernel/time.c 2003-10-02 15:15:49.000000000 +0200 @@ -257,7 +257,7 @@ int do_adjtimex(struct timex *txc) result = -EINVAL; goto leave; } - time_freq = txc->freq - pps_freq; + __time_freq = txc->freq - pps_freq; } if (txc->modes & ADJ_MAXERROR) { @@ -320,29 +320,29 @@ int do_adjtimex(struct timex *txc) ltemp = (time_offset / mtemp) << (SHIFT_USEC - SHIFT_UPDATE); if (ltemp < 0) - time_freq -= -ltemp >> SHIFT_KH; + __time_freq -= -ltemp >> SHIFT_KH; else - time_freq += ltemp >> SHIFT_KH; + __time_freq += ltemp >> SHIFT_KH; } else /* calibration interval too short (p. 12) */ result = TIME_ERROR; } else { /* PLL mode */ if (mtemp < MAXSEC) { ltemp *= mtemp; if (ltemp < 0) - time_freq -= -ltemp >> (time_constant + - time_constant + - SHIFT_KF - SHIFT_USEC); + __time_freq -= -ltemp >> (time_constant + + time_constant + + SHIFT_KF - SHIFT_USEC); else - time_freq += ltemp >> (time_constant + - time_constant + - SHIFT_KF - SHIFT_USEC); + __time_freq += ltemp >> (time_constant + + time_constant + + SHIFT_KF - SHIFT_USEC); } else /* calibration interval too long (p. 12) */ result = TIME_ERROR; } - if (time_freq > time_tolerance) - time_freq = time_tolerance; - else if (time_freq < -time_tolerance) - time_freq = -time_tolerance; + if (get_time_freq() > time_tolerance) + __time_freq = time_tolerance; + else if (get_time_freq() < -time_tolerance) + __time_freq = -time_tolerance; } /* STA_PLL || STA_PPSTIME */ } /* txc->modes & ADJ_OFFSET */ if (txc->modes & ADJ_TICK) { @@ -352,7 +352,10 @@ int do_adjtimex(struct timex *txc) result = -EINVAL; goto leave; } - tick = txc->tick; +#ifdef CONFIG_DEBUG_HZ + BUG_ON(!__tick); +#endif + __tick = txc->tick; } } /* txc->modes */ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0 @@ -375,14 +378,14 @@ leave: if ((time_status & (STA_UNSYNC|ST else txc->offset = time_offset >> SHIFT_UPDATE; } - txc->freq = time_freq + pps_freq; + txc->freq = get_time_freq() + pps_freq; txc->maxerror = time_maxerror; txc->esterror = time_esterror; txc->status = time_status; txc->constant = time_constant; txc->precision = time_precision; txc->tolerance = time_tolerance; - txc->tick = tick; + txc->tick = get_tick(); txc->ppsfreq = pps_freq; txc->jitter = pps_jitter >> PPS_AVG; txc->shift = pps_shift; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/kernel/timer.c xx/kernel/timer.c --- x-ref/kernel/timer.c 2003-10-02 15:15:46.000000000 +0200 +++ xx/kernel/timer.c 2003-10-02 15:15:49.000000000 +0200 @@ -37,14 +37,11 @@ struct kernel_stat kstat; * Timekeeping variables */ -long tick = (1000000 + HZ/2) / HZ; /* timer interrupt period */ +long __tick = (1000000 + USER_HZ/2) / USER_HZ; /* The current time */ volatile struct timeval xtime __attribute__ ((aligned (16))); -/* Don't completely fail for HZ > 500. */ -int tickadj = 500/HZ ? : 1; /* microsecs */ - DECLARE_TASK_QUEUE(tq_timer); DECLARE_TASK_QUEUE(tq_immediate); @@ -61,8 +58,7 @@ long time_precision = 1; /* clock preci long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */ long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */ long time_phase; /* phase offset (scaled us) */ -long time_freq = ((1000000 + HZ/2) % HZ - HZ/2) << SHIFT_USEC; - /* frequency offset (scaled ppm)*/ +long __time_freq; /* frequency offset (scaled ppm)*/ long time_adj; /* tick adjust (scaled 1 / HZ) */ long time_reftime; /* time at last adjustment (s) */ @@ -541,7 +537,7 @@ static void second_overflow(void) time_status &= ~(STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR); } - ltemp = time_freq + pps_freq; + ltemp = get_time_freq() + pps_freq; if (ltemp < 0) time_adj -= -ltemp >> (SHIFT_USEC + SHIFT_HZ - SHIFT_SCALE); @@ -549,15 +545,15 @@ static void second_overflow(void) time_adj += ltemp >> (SHIFT_USEC + SHIFT_HZ - SHIFT_SCALE); -#if HZ == 100 - /* Compensate for (HZ==100) != (1 << SHIFT_HZ). - * Add 25% and 3.125% to get 128.125; => only 0.125% error (p. 14) - */ - if (time_adj < 0) - time_adj -= (-time_adj >> 2) + (-time_adj >> 5); - else - time_adj += (time_adj >> 2) + (time_adj >> 5); -#endif + if (HZ == 100) { + /* Compensate for (HZ==100) != (1 << SHIFT_HZ). + * Add 25% and 3.125% to get 128.125; => only 0.125% error (p. 14) + */ + if (time_adj < 0) + time_adj -= (-time_adj >> 2) + (-time_adj >> 5); + else + time_adj += (time_adj >> 2) + (time_adj >> 5); + } } /* in the NTP reference this is called "hardclock()" */ @@ -581,7 +577,7 @@ static void update_wall_time_one_tick(vo /* Reduce by this step the amount of time left */ time_adjust -= time_adjust_step; } - xtime.tv_usec += tick + time_adjust_step; + xtime.tv_usec += get_tick() + time_adjust_step; /* * Advance the phase, once it gets to one microsecond, then * advance the tick more. @@ -706,7 +702,7 @@ unsigned long avenrun[3]; static inline void calc_load(unsigned long ticks) { unsigned long active_tasks; /* fixed-point */ - static int count = LOAD_FREQ; + static int count; count -= ticks; if (count < 0) { diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/appletalk/aarp.c xx/net/appletalk/aarp.c --- x-ref/net/appletalk/aarp.c 2003-03-15 03:25:18.000000000 +0100 +++ xx/net/appletalk/aarp.c 2003-10-02 15:15:49.000000000 +0200 @@ -60,10 +60,13 @@ #include #include -int sysctl_aarp_expiry_time = AARP_EXPIRY_TIME; -int sysctl_aarp_tick_time = AARP_TICK_TIME; +int __sysctl_aarp_expiry_time = AARP_EXPIRY_TIME; +#define sysctl_aarp_expiry_time user_to_kernel_hz_overflow(__sysctl_aarp_expiry_time) +int __sysctl_aarp_tick_time = AARP_TICK_TIME; +#define sysctl_aarp_tick_time user_to_kernel_hz_overflow(__sysctl_aarp_tick_time) int sysctl_aarp_retransmit_limit = AARP_RETRANSMIT_LIMIT; -int sysctl_aarp_resolve_time = AARP_RESOLVE_TIME; +int __sysctl_aarp_resolve_time = AARP_RESOLVE_TIME; +#define sysctl_aarp_resolve_time user_to_kernel_hz_overflow(__sysctl_aarp_resolve_time) /* Lists of aarp entries */ struct aarp_entry { diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/appletalk/sysctl_net_atalk.c xx/net/appletalk/sysctl_net_atalk.c --- x-ref/net/appletalk/sysctl_net_atalk.c 2003-03-15 03:25:18.000000000 +0100 +++ xx/net/appletalk/sysctl_net_atalk.c 2003-10-02 15:15:49.000000000 +0200 @@ -10,21 +10,21 @@ #include #include -extern int sysctl_aarp_expiry_time; -extern int sysctl_aarp_tick_time; +extern int __sysctl_aarp_expiry_time; +extern int __sysctl_aarp_tick_time; extern int sysctl_aarp_retransmit_limit; -extern int sysctl_aarp_resolve_time; +extern int __sysctl_aarp_resolve_time; #ifdef CONFIG_SYSCTL static ctl_table atalk_table[] = { {NET_ATALK_AARP_EXPIRY_TIME, "aarp-expiry-time", - &sysctl_aarp_expiry_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, + &__sysctl_aarp_expiry_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, {NET_ATALK_AARP_TICK_TIME, "aarp-tick-time", - &sysctl_aarp_tick_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, + &__sysctl_aarp_tick_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, {NET_ATALK_AARP_RETRANSMIT_LIMIT, "aarp-retransmit-limit", &sysctl_aarp_retransmit_limit, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_ATALK_AARP_RESOLVE_TIME, "aarp-resolve-time", - &sysctl_aarp_resolve_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, + &__sysctl_aarp_resolve_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, {0} }; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/atm/clip.c xx/net/atm/clip.c --- x-ref/net/atm/clip.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/atm/clip.c 2003-10-02 15:15:49.000000000 +0200 @@ -350,21 +350,21 @@ static struct neigh_table clip_tbl = { 0, /* entries */ NULL, /* priv */ NULL, /* sysctl_table */ - 30*HZ, /* base_reachable_time */ - 1*HZ, /* retrans_time */ - 60*HZ, /* gc_staletime */ - 30*HZ, /* reachable_time */ - 5*HZ, /* delay_probe_time */ + 30*USER_HZ, /* base_reachable_time */ + 1*USER_HZ, /* retrans_time */ + 60*USER_HZ, /* gc_staletime */ + 30*USER_HZ, /* reachable_time */ + 5*USER_HZ, /* delay_probe_time */ 3, /* queue_len */ 3, /* ucast_probes */ 0, /* app_probes */ 3, /* mcast_probes */ - 1*HZ, /* anycast_delay */ - (8*HZ)/10, /* proxy_delay */ - 1*HZ, /* proxy_qlen */ - 64 /* locktime */ + 1*USER_HZ, /* anycast_delay */ + (8*USER_HZ)/10, /* proxy_delay */ + 64, /* proxy_qlen */ + 1*USER_HZ, /* locktime */ }, - 30*HZ,128,512,1024 /* copied from ARP ... */ + 30*USER_HZ,128,512,1024 /* copied from ARP ... */ }; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ax25/af_ax25.c xx/net/ax25/af_ax25.c --- x-ref/net/ax25/af_ax25.c 2003-03-15 03:25:18.000000000 +0100 +++ xx/net/ax25/af_ax25.c 2003-10-02 15:15:49.000000000 +0200 @@ -557,12 +557,12 @@ void ax25_fillin_cb(ax25_cb *ax25, ax25_ if (ax25->ax25_dev != NULL) { ax25->rtt = ax25_dev->values[AX25_VALUES_T1] / 2; - ax25->t1 = ax25_dev->values[AX25_VALUES_T1]; - ax25->t2 = ax25_dev->values[AX25_VALUES_T2]; - ax25->t3 = ax25_dev->values[AX25_VALUES_T3]; + ax25->t1 = user_to_kernel_hz_overflow(ax25_dev->values[AX25_VALUES_T1]); + ax25->t2 = user_to_kernel_hz_overflow(ax25_dev->values[AX25_VALUES_T2]); + ax25->t3 = user_to_kernel_hz_overflow(ax25_dev->values[AX25_VALUES_T3]); ax25->n2 = ax25_dev->values[AX25_VALUES_N2]; ax25->paclen = ax25_dev->values[AX25_VALUES_PACLEN]; - ax25->idle = ax25_dev->values[AX25_VALUES_IDLE]; + ax25->idle = user_to_kernel_hz_overflow(ax25_dev->values[AX25_VALUES_IDLE]); ax25->backoff = ax25_dev->values[AX25_VALUES_BACKOFF]; if (ax25_dev->values[AX25_VALUES_AXDEFMODE]) { diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ax25/ax25_ds_timer.c xx/net/ax25/ax25_ds_timer.c --- x-ref/net/ax25/ax25_ds_timer.c 2003-03-15 03:25:18.000000000 +0100 +++ xx/net/ax25/ax25_ds_timer.c 2003-10-02 15:15:49.000000000 +0200 @@ -66,7 +66,7 @@ void ax25_ds_set_timer(ax25_dev *ax25_de return; del_timer(&ax25_dev->dama.slave_timer); - ax25_dev->dama.slave_timeout = ax25_dev->values[AX25_VALUES_DS_TIMEOUT] / 10; + ax25_dev->dama.slave_timeout = user_to_kernel_hz_overflow(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10; ax25_ds_add_timer(ax25_dev); } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ax25/sysctl_net_ax25.c xx/net/ax25/sysctl_net_ax25.c --- x-ref/net/ax25/sysctl_net_ax25.c 2003-03-15 03:25:18.000000000 +0100 +++ xx/net/ax25/sysctl_net_ax25.c 2003-10-02 15:15:49.000000000 +0200 @@ -16,14 +16,14 @@ static int min_backoff[] = {0}, max_bac static int min_conmode[] = {0}, max_conmode[] = {2}; static int min_window[] = {1}, max_window[] = {7}; static int min_ewindow[] = {1}, max_ewindow[] = {63}; -static int min_t1[] = {1}, max_t1[] = {30 * HZ}; -static int min_t2[] = {1}, max_t2[] = {20 * HZ}; -static int min_t3[] = {0}, max_t3[] = {3600 * HZ}; -static int min_idle[] = {0}, max_idle[] = {65535 * HZ}; +static int min_t1[] = {1}, max_t1[] = {30 * USER_HZ}; +static int min_t2[] = {1}, max_t2[] = {20 * USER_HZ}; +static int min_t3[] = {0}, max_t3[] = {3600 * USER_HZ}; +static int min_idle[] = {0}, max_idle[] = {65535 * USER_HZ}; static int min_n2[] = {1}, max_n2[] = {31}; static int min_paclen[] = {1}, max_paclen[] = {512}; static int min_proto[] = {0}, max_proto[] = {3}; -static int min_ds_timeout[] = {0}, max_ds_timeout[] = {65535 * HZ}; +static int min_ds_timeout[] = {0}, max_ds_timeout[] = {65535 * USER_HZ}; static struct ctl_table_header *ax25_table_header; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/core/dst.c xx/net/core/dst.c --- x-ref/net/core/dst.c 2003-08-26 00:13:18.000000000 +0200 +++ xx/net/core/dst.c 2003-10-02 15:15:49.000000000 +0200 @@ -34,11 +34,11 @@ static atomic_t dst_total = ATOMIC_IN static spinlock_t dst_lock = SPIN_LOCK_UNLOCKED; static unsigned long dst_gc_timer_expires; -static unsigned long dst_gc_timer_inc = DST_GC_MAX; +static unsigned long dst_gc_timer_inc; static void dst_run_gc(unsigned long); static struct timer_list dst_gc_timer = - { data: DST_GC_MIN, function: dst_run_gc }; + { function: dst_run_gc, }; static void dst_run_gc(unsigned long dummy) @@ -215,5 +215,9 @@ struct notifier_block dst_dev_notifier = void __init dst_init(void) { + if (dst_gc_timer_inc) + printk(KERN_ERR "dst_gc_timer_inc already in use\n"); + dst_gc_timer_inc = DST_GC_MAX; + dst_gc_timer.data = DST_GC_MIN; register_netdevice_notifier(&dst_dev_notifier); } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/core/neighbour.c xx/net/core/neighbour.c --- x-ref/net/core/neighbour.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/core/neighbour.c 2003-10-02 15:15:49.000000000 +0200 @@ -1133,6 +1133,16 @@ void neigh_table_init(struct neigh_table { unsigned long now = jiffies; + tbl->parms.base_reachable_time = user_to_kernel_hz_overflow(tbl->parms.base_reachable_time); + tbl->parms.retrans_time = user_to_kernel_hz_overflow(tbl->parms.retrans_time); + tbl->parms.gc_staletime = user_to_kernel_hz_overflow(tbl->parms.gc_staletime); + tbl->parms.reachable_time = user_to_kernel_hz_overflow(tbl->parms.reachable_time); + tbl->parms.delay_probe_time = user_to_kernel_hz_overflow(tbl->parms.delay_probe_time); + tbl->parms.anycast_delay = user_to_kernel_hz_overflow(tbl->parms.anycast_delay); + tbl->parms.proxy_delay = user_to_kernel_hz_overflow(tbl->parms.proxy_delay); + tbl->parms.locktime = user_to_kernel_hz_overflow(tbl->parms.locktime); + tbl->gc_interval = user_to_kernel_hz_overflow(tbl->gc_interval); + tbl->parms.reachable_time = neigh_rand_reach_time(tbl->parms.base_reachable_time); if (tbl->kmem_cachep == NULL) @@ -1481,6 +1491,7 @@ struct neigh_sysctl_table {NET_NEIGH_RETRANS_TIME, "retrans_time", NULL, sizeof(int), 0644, NULL, &proc_dointvec}, + /* fixme should be exported in HZ indipendent units */ {NET_NEIGH_REACHABLE_TIME, "base_reachable_time", NULL, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/core/utils.c xx/net/core/utils.c --- x-ref/net/core/utils.c 2003-03-15 03:25:19.000000000 +0100 +++ xx/net/core/utils.c 2003-10-02 15:15:49.000000000 +0200 @@ -35,8 +35,8 @@ void net_srandom(unsigned long entropy) net_random(); } -int net_msg_cost = 5*HZ; -int net_msg_burst = 10*5*HZ; +int net_msg_cost = 5 * USER_HZ; +int net_msg_burst = 10*5 * USER_HZ; /* * This enforces a rate limit: not more than one kernel message @@ -47,14 +47,14 @@ int net_msg_burst = 10*5*HZ; int net_ratelimit(void) { static spinlock_t ratelimit_lock = SPIN_LOCK_UNLOCKED; - static unsigned long toks = 10*5*HZ; + static unsigned long toks = 10*5*USER_HZ; static unsigned long last_msg; static int missed; unsigned long flags; unsigned long now = jiffies; spin_lock_irqsave(&ratelimit_lock, flags); - toks += now - last_msg; + toks += jiffies_to_clock_t(now - last_msg); last_msg = now; if (toks > net_msg_burst) toks = net_msg_burst; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/decnet/dn_neigh.c xx/net/decnet/dn_neigh.c --- x-ref/net/decnet/dn_neigh.c 2003-03-15 03:25:19.000000000 +0100 +++ xx/net/decnet/dn_neigh.c 2003-10-02 15:15:49.000000000 +0200 @@ -96,11 +96,11 @@ struct neigh_table dn_neigh_table = { parms: { tbl: &dn_neigh_table, entries: 0, - base_reachable_time: 30 * HZ, - retrans_time: 1 * HZ, - gc_staletime: 60 * HZ, - reachable_time: 30 * HZ, - delay_probe_time: 5 * HZ, + base_reachable_time: 30 * USER_HZ, + retrans_time: 1 * USER_HZ, + gc_staletime: 60 * USER_HZ, + reachable_time: 30 * USER_HZ, + delay_probe_time: 5 * USER_HZ, queue_len: 3, ucast_probes: 0, app_probes: 0, @@ -108,9 +108,9 @@ struct neigh_table dn_neigh_table = { anycast_delay: 0, proxy_delay: 0, proxy_qlen: 0, - locktime: 1 * HZ, + locktime: 1 * USER_HZ, }, - gc_interval: 30 * HZ, + gc_interval: 30 * USER_HZ, gc_thresh1: 128, gc_thresh2: 512, gc_thresh3: 1024, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/decnet/dn_route.c xx/net/decnet/dn_route.c --- x-ref/net/decnet/dn_route.c 2003-03-15 03:25:19.000000000 +0100 +++ xx/net/decnet/dn_route.c 2003-10-02 15:15:49.000000000 +0200 @@ -94,8 +94,8 @@ extern struct neigh_table dn_neigh_table static unsigned char dn_hiord_addr[6] = {0xAA,0x00,0x04,0x00,0x00,0x00}; -int dn_rt_min_delay = 2*HZ; -int dn_rt_max_delay = 10*HZ; +#define dn_rt_min_delay (2*HZ) +#define dn_rt_max_delay (10*HZ) static unsigned long dn_rt_deadline = 0; static int dn_dst_gc(void); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/arp.c xx/net/ipv4/arp.c --- x-ref/net/ipv4/arp.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/ipv4/arp.c 2003-10-02 15:15:49.000000000 +0200 @@ -172,20 +172,20 @@ struct neigh_table arp_tbl = { id: "arp_cache", parms: { tbl: &arp_tbl, - base_reachable_time: 30 * HZ, - retrans_time: 1 * HZ, - gc_staletime: 60 * HZ, - reachable_time: 30 * HZ, - delay_probe_time: 5 * HZ, + base_reachable_time: 30 * USER_HZ, + retrans_time: 1 * USER_HZ, + gc_staletime: 60 * USER_HZ, + reachable_time: 30 * USER_HZ, + delay_probe_time: 5 * USER_HZ, queue_len: 3, ucast_probes: 3, mcast_probes: 3, - anycast_delay: 1 * HZ, - proxy_delay: (8 * HZ) / 10, + anycast_delay: 1 * USER_HZ, + proxy_delay: (8 * USER_HZ) / 10, proxy_qlen: 64, - locktime: 1 * HZ, + locktime: 1 * USER_HZ, }, - gc_interval: 30 * HZ, + gc_interval: 30 * USER_HZ, gc_thresh1: 128, gc_thresh2: 512, gc_thresh3: 1024, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/icmp.c xx/net/ipv4/icmp.c --- x-ref/net/ipv4/icmp.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/ipv4/icmp.c 2003-10-02 15:15:49.000000000 +0200 @@ -160,7 +160,8 @@ int sysctl_icmp_ignore_bogus_error_respo * time exceeded (11), parameter problem (12) */ -int sysctl_icmp_ratelimit = 1*HZ; +int __sysctl_icmp_ratelimit = 1*USER_HZ; +#define sysctl_icmp_ratelimit user_to_kernel_hz_overflow(__sysctl_icmp_ratelimit) int sysctl_icmp_ratemask = 0x1818; /* diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/ip_fragment.c xx/net/ipv4/ip_fragment.c --- x-ref/net/ipv4/ip_fragment.c 2003-06-13 22:07:42.000000000 +0200 +++ xx/net/ipv4/ip_fragment.c 2003-10-02 15:15:49.000000000 +0200 @@ -58,7 +58,8 @@ int sysctl_ipfrag_low_thresh = 192*1024; /* Important NOTE! Fragment queue must be destroyed before MSL expires. * RFC791 is wrong proposing to prolongate timer each fragment arrival by TTL. */ -int sysctl_ipfrag_time = IP_FRAG_TIME; +int __sysctl_ipfrag_time = IP_FRAG_TIME; +#define sysctl_ipfrag_time user_to_kernel_hz_overflow(__sysctl_ipfrag_time) struct ipfrag_skb_cb { @@ -126,7 +127,8 @@ static unsigned int ipqhashfn(u16 id, u3 } static struct timer_list ipfrag_secret_timer; -int sysctl_ipfrag_secret_interval = 10 * 60 * HZ; +#define sysctl_ipfrag_secret_interval user_to_kernel_hz_overflow(__sysctl_ipfrag_secret_interval) +int __sysctl_ipfrag_secret_interval = 10 * 60 * USER_HZ; static void ipfrag_secret_rebuild(unsigned long dummy) { diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/ipvs/ip_vs_conn.c xx/net/ipv4/ipvs/ip_vs_conn.c --- x-ref/net/ipv4/ipvs/ip_vs_conn.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/ipv4/ipvs/ip_vs_conn.c 2003-10-02 15:15:49.000000000 +0200 @@ -305,48 +305,8 @@ void ip_vs_conn_put(struct ip_vs_conn *c /* * Timeout table[state] */ -struct ip_vs_timeout_table vs_timeout_table = { - ATOMIC_INIT(0), /* refcnt */ - 0, /* scale */ - { - [IP_VS_S_NONE] = 30*60*HZ, - [IP_VS_S_ESTABLISHED] = 15*60*HZ, - [IP_VS_S_SYN_SENT] = 2*60*HZ, - [IP_VS_S_SYN_RECV] = 1*60*HZ, - [IP_VS_S_FIN_WAIT] = 2*60*HZ, - [IP_VS_S_TIME_WAIT] = 2*60*HZ, - [IP_VS_S_CLOSE] = 10*HZ, - [IP_VS_S_CLOSE_WAIT] = 60*HZ, - [IP_VS_S_LAST_ACK] = 30*HZ, - [IP_VS_S_LISTEN] = 2*60*HZ, - [IP_VS_S_SYNACK] = 120*HZ, - [IP_VS_S_UDP] = 5*60*HZ, - [IP_VS_S_ICMP] = 1*60*HZ, - [IP_VS_S_LAST] = 2*HZ, - }, /* timeout */ -}; - - -struct ip_vs_timeout_table vs_timeout_table_dos = { - ATOMIC_INIT(0), /* refcnt */ - 0, /* scale */ - { - [IP_VS_S_NONE] = 15*60*HZ, - [IP_VS_S_ESTABLISHED] = 8*60*HZ, - [IP_VS_S_SYN_SENT] = 60*HZ, - [IP_VS_S_SYN_RECV] = 10*HZ, - [IP_VS_S_FIN_WAIT] = 60*HZ, - [IP_VS_S_TIME_WAIT] = 60*HZ, - [IP_VS_S_CLOSE] = 10*HZ, - [IP_VS_S_CLOSE_WAIT] = 60*HZ, - [IP_VS_S_LAST_ACK] = 30*HZ, - [IP_VS_S_LISTEN] = 2*60*HZ, - [IP_VS_S_SYNACK] = 100*HZ, - [IP_VS_S_UDP] = 3*60*HZ, - [IP_VS_S_ICMP] = 1*60*HZ, - [IP_VS_S_LAST] = 2*HZ, - }, /* timeout */ -}; +struct ip_vs_timeout_table vs_timeout_table; +struct ip_vs_timeout_table vs_timeout_table_dos; /* @@ -1507,11 +1467,57 @@ static void ip_vs_conn_flush(void) } } +static void ip_vs_conn_init_timeout_tables(void) +{ + + vs_timeout_table = (struct ip_vs_timeout_table) { + ATOMIC_INIT(0), /* refcnt */ + 0, /* scale */ + { + [IP_VS_S_NONE] = 30*60*HZ, + [IP_VS_S_ESTABLISHED] = 15*60*HZ, + [IP_VS_S_SYN_SENT] = 2*60*HZ, + [IP_VS_S_SYN_RECV] = 1*60*HZ, + [IP_VS_S_FIN_WAIT] = 2*60*HZ, + [IP_VS_S_TIME_WAIT] = 2*60*HZ, + [IP_VS_S_CLOSE] = 10*HZ, + [IP_VS_S_CLOSE_WAIT] = 60*HZ, + [IP_VS_S_LAST_ACK] = 30*HZ, + [IP_VS_S_LISTEN] = 2*60*HZ, + [IP_VS_S_SYNACK] = 120*HZ, + [IP_VS_S_UDP] = 5*60*HZ, + [IP_VS_S_ICMP] = 1*60*HZ, + [IP_VS_S_LAST] = 2*HZ, + }, /* timeout */ + }; + vs_timeout_table_dos = (struct ip_vs_timeout_table ) { + ATOMIC_INIT(0), /* refcnt */ + 0, /* scale */ + { + [IP_VS_S_NONE] = 15*60*HZ, + [IP_VS_S_ESTABLISHED] = 8*60*HZ, + [IP_VS_S_SYN_SENT] = 60*HZ, + [IP_VS_S_SYN_RECV] = 10*HZ, + [IP_VS_S_FIN_WAIT] = 60*HZ, + [IP_VS_S_TIME_WAIT] = 60*HZ, + [IP_VS_S_CLOSE] = 10*HZ, + [IP_VS_S_CLOSE_WAIT] = 60*HZ, + [IP_VS_S_LAST_ACK] = 30*HZ, + [IP_VS_S_LISTEN] = 2*60*HZ, + [IP_VS_S_SYNACK] = 100*HZ, + [IP_VS_S_UDP] = 3*60*HZ, + [IP_VS_S_ICMP] = 1*60*HZ, + [IP_VS_S_LAST] = 2*HZ, + }, /* timeout */ + }; +} int ip_vs_conn_init(void) { int idx; + ip_vs_conn_init_timeout_tables(); + /* * Allocate the connection hash table and initialize its list heads */ diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/ipvs/ip_vs_lblc.c xx/net/ipv4/ipvs/ip_vs_lblc.c --- x-ref/net/ipv4/ipvs/ip_vs_lblc.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/ipv4/ipvs/ip_vs_lblc.c 2003-10-02 15:15:49.000000000 +0200 @@ -69,7 +69,8 @@ * entries that haven't been touched for a day. */ #define COUNT_FOR_FULL_EXPIRATION 30 -int sysctl_ip_vs_lblc_expiration = 24*60*60*HZ; +int __sysctl_ip_vs_lblc_expiration = 24*60*60*USER_HZ; +#define sysctl_ip_vs_lblc_expiration user_to_kernel_hz(__sysctl_ip_vs_lblc_expiration) /* @@ -124,7 +125,7 @@ struct ip_vs_lblc_sysctl_table { static struct ip_vs_lblc_sysctl_table lblc_sysctl_table = { NULL, {{NET_IPV4_VS_LBLC_EXPIRE, "lblc_expiration", - &sysctl_ip_vs_lblc_expiration, + &__sysctl_ip_vs_lblc_expiration, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, {0}}, {{NET_IPV4_VS, "vs", NULL, 0, 0555, lblc_sysctl_table.vs_vars}, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/ipvs/ip_vs_lblcr.c xx/net/ipv4/ipvs/ip_vs_lblcr.c --- x-ref/net/ipv4/ipvs/ip_vs_lblcr.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/ipv4/ipvs/ip_vs_lblcr.c 2003-10-02 15:15:49.000000000 +0200 @@ -69,7 +69,8 @@ * entries that haven't been touched for a day. */ #define COUNT_FOR_FULL_EXPIRATION 30 -int sysctl_ip_vs_lblcr_expiration = 24*60*60*HZ; +int __sysctl_ip_vs_lblcr_expiration = 24*60*60*USER_HZ; +#define sysctl_ip_vs_lblcr_expiration user_to_kernel_hz(__sysctl_ip_vs_lblcr_expiration) /* @@ -307,7 +308,7 @@ struct ip_vs_lblcr_sysctl_table { static struct ip_vs_lblcr_sysctl_table lblcr_sysctl_table = { NULL, {{NET_IPV4_VS_LBLCR_EXPIRE, "lblcr_expiration", - &sysctl_ip_vs_lblcr_expiration, + &__sysctl_ip_vs_lblcr_expiration, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, {0}}, {{NET_IPV4_VS, "vs", NULL, 0, 0555, lblcr_sysctl_table.vs_vars}, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/netfilter/ip_conntrack_proto_tcp.c xx/net/ipv4/netfilter/ip_conntrack_proto_tcp.c --- x-ref/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2003-10-02 15:15:35.000000000 +0200 +++ xx/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2003-10-02 15:15:49.000000000 +0200 @@ -44,7 +44,7 @@ static const char *tcp_conntrack_names[] "LISTEN" }; -#define SECS *HZ +#define SECS *USER_HZ #define MINS * 60 SECS #define HOURS * 60 MINS #define DAYS * 24 HOURS @@ -206,7 +206,7 @@ static int tcp_packet(struct ip_conntrac set_bit(IPS_ASSURED_BIT, &conntrack->status); WRITE_UNLOCK(&tcp_lock); - ip_ct_refresh(conntrack, tcp_timeouts[newconntrack]); + ip_ct_refresh(conntrack, user_to_kernel_hz(tcp_timeouts[newconntrack])); } return NF_ACCEPT; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/netfilter/ipt_ULOG.c xx/net/ipv4/netfilter/ipt_ULOG.c --- x-ref/net/ipv4/netfilter/ipt_ULOG.c 2003-08-26 00:13:18.000000000 +0200 +++ xx/net/ipv4/netfilter/ipt_ULOG.c 2003-10-02 15:15:49.000000000 +0200 @@ -73,7 +73,7 @@ static unsigned int nlbufsiz = 4096; MODULE_PARM(nlbufsiz, "i"); MODULE_PARM_DESC(nlbufsiz, "netlink buffer size"); -static unsigned int flushtimeout = 10 * HZ; +static unsigned int flushtimeout = 10 * USER_HZ; MODULE_PARM(flushtimeout, "i"); MODULE_PARM_DESC(flushtimeout, "buffer flush timeout"); @@ -256,7 +256,7 @@ static unsigned int ipt_ulog_target(stru /* if timer isn't already running, start it */ if (!timer_pending(&ub->timer)) { - ub->timer.expires = jiffies + flushtimeout; + ub->timer.expires = jiffies + user_to_kernel_hz_overflow(flushtimeout); add_timer(&ub->timer); } diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/route.c xx/net/ipv4/route.c --- x-ref/net/ipv4/route.c 2003-10-02 15:15:32.000000000 +0200 +++ xx/net/ipv4/route.c 2003-10-02 15:15:49.000000000 +0200 @@ -100,26 +100,38 @@ #define IP_MAX_MTU 0xFFF0 -#define RT_GC_TIMEOUT (300*HZ) +#define RT_GC_TIMEOUT (300*USER_HZ) -int ip_rt_min_delay = 2 * HZ; -int ip_rt_max_delay = 10 * HZ; +int __ip_rt_min_delay = 2 * USER_HZ; +int __ip_rt_max_delay = 10 * USER_HZ; int ip_rt_max_size; -int ip_rt_gc_timeout = RT_GC_TIMEOUT; -int ip_rt_gc_interval = 60 * HZ; -int ip_rt_gc_min_interval = HZ / 2; +int __ip_rt_gc_timeout = RT_GC_TIMEOUT; +int __ip_rt_gc_interval = 60 * USER_HZ; +int __ip_rt_gc_min_interval = USER_HZ / 2; int ip_rt_redirect_number = 9; -int ip_rt_redirect_load = HZ / 50; -int ip_rt_redirect_silence = ((HZ / 50) << (9 + 1)); -int ip_rt_error_cost = HZ; -int ip_rt_error_burst = 5 * HZ; +int __ip_rt_redirect_load = USER_HZ / 50; +int __ip_rt_redirect_silence = ((USER_HZ / 50) << (9 + 1)); +int __ip_rt_error_cost = USER_HZ; +int __ip_rt_error_burst = 5 * USER_HZ; int ip_rt_gc_elasticity = 8; -int ip_rt_mtu_expires = 10 * 60 * HZ; +int __ip_rt_mtu_expires = 10 * 60 * USER_HZ; int ip_rt_min_pmtu = 512 + 20 + 20; int ip_rt_min_advmss = 256; -int ip_rt_secret_interval = 10 * 60 * HZ; +int __ip_rt_secret_interval = 10 * 60 * USER_HZ; static unsigned long rt_deadline; +#define ip_rt_min_delay user_to_kernel_hz_overflow(__ip_rt_min_delay) +#define ip_rt_max_delay user_to_kernel_hz_overflow(__ip_rt_max_delay) +#define ip_rt_gc_timeout user_to_kernel_hz_overflow(__ip_rt_gc_timeout) +#define ip_rt_gc_interval user_to_kernel_hz_overflow(__ip_rt_gc_interval) +#define ip_rt_gc_min_interval user_to_kernel_hz_overflow(__ip_rt_gc_min_interval) +#define ip_rt_redirect_load user_to_kernel_hz_overflow(__ip_rt_redirect_load) +#define ip_rt_redirect_silence user_to_kernel_hz_overflow(__ip_rt_redirect_silence) +#define ip_rt_error_cost user_to_kernel_hz_overflow(__ip_rt_error_cost) +#define ip_rt_error_burst user_to_kernel_hz_overflow(__ip_rt_error_burst) +#define ip_rt_mtu_expires user_to_kernel_hz_overflow(__ip_rt_mtu_expires) +#define ip_rt_secret_interval user_to_kernel_hz_overflow(__ip_rt_secret_interval) + #define RTprint(a...) printk(KERN_DEBUG a) static struct timer_list rt_flush_timer; @@ -579,13 +591,13 @@ static int rt_garbage_collect(void) int i, k; for (i = rt_hash_mask, k = rover; i >= 0; i--) { - unsigned long tmo = expire; + unsigned long tmo = user_to_kernel_hz_overflow(expire); k = (k + 1) & rt_hash_mask; rthp = &rt_hash_table[k].chain; write_lock_bh(&rt_hash_table[k].lock); while ((rth = *rthp) != NULL) { - if (!rt_may_expire(rth, tmo, expire)) { + if (!rt_may_expire(rth, tmo, user_to_kernel_hz_overflow(expire))) { tmo >>= 1; rthp = &rth->u.rt_next; continue; @@ -619,7 +631,7 @@ static int rt_garbage_collect(void) expire >>= 1; #if RT_CACHE_DEBUG >= 2 - printk(KERN_DEBUG "expire>> %u %d %d %d\n", expire, + printk(KERN_DEBUG "expire>> %u %d %d %d\n", user_to_kernel_hz_overflow(expire), atomic_read(&ipv4_dst_ops.entries), goal, i); #endif @@ -635,12 +647,12 @@ static int rt_garbage_collect(void) return 1; work_done: - expire += ip_rt_gc_min_interval; - if (expire > ip_rt_gc_timeout || + expire += __ip_rt_gc_min_interval; + if (user_to_kernel_hz_overflow(expire) > ip_rt_gc_timeout || atomic_read(&ipv4_dst_ops.entries) < ipv4_dst_ops.gc_thresh) - expire = ip_rt_gc_timeout; + expire = __ip_rt_gc_timeout; #if RT_CACHE_DEBUG >= 2 - printk(KERN_DEBUG "expire++ %u %d %d %d\n", expire, + printk(KERN_DEBUG "expire++ %u %d %d %d\n", user_to_kernel_hz_overflow(expire), atomic_read(&ipv4_dst_ops.entries), goal, rover); #endif out: return 0; @@ -729,11 +741,11 @@ restart: */ if (attempts-- > 0) { int saved_elasticity = ip_rt_gc_elasticity; - int saved_int = ip_rt_gc_min_interval; + int saved_int = __ip_rt_gc_min_interval; ip_rt_gc_elasticity = 1; - ip_rt_gc_min_interval = 0; + __ip_rt_gc_min_interval = 0; rt_garbage_collect(); - ip_rt_gc_min_interval = saved_int; + __ip_rt_gc_min_interval = saved_int; ip_rt_gc_elasticity = saved_elasticity; goto restart; } @@ -2308,7 +2320,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_MIN_DELAY, procname: "min_delay", - data: &ip_rt_min_delay, + data: &__ip_rt_min_delay, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec_jiffies, @@ -2317,7 +2329,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_MAX_DELAY, procname: "max_delay", - data: &ip_rt_max_delay, + data: &__ip_rt_max_delay, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec_jiffies, @@ -2342,7 +2354,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_GC_MIN_INTERVAL, procname: "gc_min_interval", - data: &ip_rt_gc_min_interval, + data: &__ip_rt_gc_min_interval, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec_jiffies, @@ -2351,7 +2363,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_GC_TIMEOUT, procname: "gc_timeout", - data: &ip_rt_gc_timeout, + data: &__ip_rt_gc_timeout, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec_jiffies, @@ -2360,7 +2372,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_GC_INTERVAL, procname: "gc_interval", - data: &ip_rt_gc_interval, + data: &__ip_rt_gc_interval, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec_jiffies, @@ -2369,7 +2381,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_REDIRECT_LOAD, procname: "redirect_load", - data: &ip_rt_redirect_load, + data: &__ip_rt_redirect_load, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec, @@ -2385,7 +2397,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_REDIRECT_SILENCE, procname: "redirect_silence", - data: &ip_rt_redirect_silence, + data: &__ip_rt_redirect_silence, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec, @@ -2393,7 +2405,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_ERROR_COST, procname: "error_cost", - data: &ip_rt_error_cost, + data: &__ip_rt_error_cost, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec, @@ -2401,7 +2413,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_ERROR_BURST, procname: "error_burst", - data: &ip_rt_error_burst, + data: &__ip_rt_error_burst, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec, @@ -2417,7 +2429,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_MTU_EXPIRES, procname: "mtu_expires", - data: &ip_rt_mtu_expires, + data: &__ip_rt_mtu_expires, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec_jiffies, @@ -2442,7 +2454,7 @@ ctl_table ipv4_route_table[] = { { ctl_name: NET_IPV4_ROUTE_SECRET_INTERVAL, procname: "secret_interval", - data: &ip_rt_secret_interval, + data: &__ip_rt_secret_interval, maxlen: sizeof(int), mode: 0644, proc_handler: &proc_dointvec_jiffies, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/sysctl_net_ipv4.c xx/net/ipv4/sysctl_net_ipv4.c --- x-ref/net/ipv4/sysctl_net_ipv4.c 2003-10-02 15:15:32.000000000 +0200 +++ xx/net/ipv4/sysctl_net_ipv4.c 2003-10-02 15:15:49.000000000 +0200 @@ -26,14 +26,14 @@ extern int sysctl_icmp_ignore_bogus_erro /* From ip_fragment.c */ extern int sysctl_ipfrag_low_thresh; extern int sysctl_ipfrag_high_thresh; -extern int sysctl_ipfrag_time; -extern int sysctl_ipfrag_secret_interval; +extern int __sysctl_ipfrag_time; +extern int __sysctl_ipfrag_secret_interval; /* From ip_output.c */ extern int sysctl_ip_dynaddr; /* From icmp.c */ -extern int sysctl_icmp_ratelimit; +extern int __sysctl_icmp_ratelimit; extern int sysctl_icmp_ratemask; /* From igmp.c */ @@ -124,16 +124,16 @@ ctl_table ipv4_table[] = { {NET_IPV4_DYNADDR, "ip_dynaddr", &sysctl_ip_dynaddr, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_IPV4_IPFRAG_TIME, "ipfrag_time", - &sysctl_ipfrag_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, + &__sysctl_ipfrag_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, {NET_IPV4_TCP_KEEPALIVE_TIME, "tcp_keepalive_time", - &sysctl_tcp_keepalive_time, sizeof(int), 0644, NULL, + &__sysctl_tcp_keepalive_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, {NET_IPV4_TCP_KEEPALIVE_PROBES, "tcp_keepalive_probes", &sysctl_tcp_keepalive_probes, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_IPV4_TCP_KEEPALIVE_INTVL, "tcp_keepalive_intvl", - &sysctl_tcp_keepalive_intvl, sizeof(int), 0644, NULL, + &__sysctl_tcp_keepalive_intvl, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, {NET_IPV4_TCP_RETRIES1, "tcp_retries1", &sysctl_tcp_retries1, sizeof(int), 0644, NULL, &proc_dointvec_minmax, @@ -141,7 +141,7 @@ ctl_table ipv4_table[] = { {NET_IPV4_TCP_RETRIES2, "tcp_retries2", &sysctl_tcp_retries2, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_IPV4_TCP_FIN_TIMEOUT, "tcp_fin_timeout", - &sysctl_tcp_fin_timeout, sizeof(int), 0644, NULL, + &__sysctl_tcp_fin_timeout, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, #ifdef CONFIG_SYN_COOKIES {NET_TCP_SYNCOOKIES, "tcp_syncookies", @@ -194,7 +194,7 @@ ctl_table ipv4_table[] = { {NET_TCP_ADV_WIN_SCALE, "tcp_adv_win_scale", &sysctl_tcp_adv_win_scale, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_IPV4_ICMP_RATELIMIT, "icmp_ratelimit", - &sysctl_icmp_ratelimit, sizeof(int), 0644, NULL, &proc_dointvec}, + &__sysctl_icmp_ratelimit, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_IPV4_ICMP_RATEMASK, "icmp_ratemask", &sysctl_icmp_ratemask, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_TCP_TW_REUSE, "tcp_tw_reuse", @@ -204,7 +204,7 @@ ctl_table ipv4_table[] = { {NET_TCP_LOW_LATENCY, "tcp_low_latency", &sysctl_tcp_low_latency, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_IPV4_IPFRAG_SECRET_INTERVAL, "ipfrag_secret_interval", - &sysctl_ipfrag_secret_interval, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, + &__sysctl_ipfrag_secret_interval, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, {0} }; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/tcp.c xx/net/ipv4/tcp.c --- x-ref/net/ipv4/tcp.c 2003-10-02 15:15:40.000000000 +0200 +++ xx/net/ipv4/tcp.c 2003-10-02 15:15:49.000000000 +0200 @@ -260,7 +260,7 @@ #include #include -int sysctl_tcp_fin_timeout = TCP_FIN_TIMEOUT; +int __sysctl_tcp_fin_timeout = TCP_FIN_TIMEOUT; struct tcp_mib tcp_statistics[NR_CPUS*2]; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv4/tcp_minisocks.c xx/net/ipv4/tcp_minisocks.c --- x-ref/net/ipv4/tcp_minisocks.c 2003-10-02 15:15:40.000000000 +0200 +++ xx/net/ipv4/tcp_minisocks.c 2003-10-02 15:15:49.000000000 +0200 @@ -503,7 +503,7 @@ void tcp_tw_schedule(struct tcp_tw_bucke * is greater than TS tick!) and detect old duplicates with help * of PAWS. */ - slot = (timeo + (1<> TCP_TW_RECYCLE_TICK; + slot = (timeo + (1<> TCP_TW_RECYCLE_TICK(); spin_lock(&tw_death_lock); @@ -530,16 +530,16 @@ void tcp_tw_schedule(struct tcp_tw_bucke slot = (tcp_tw_death_row_slot + slot) & (TCP_TWKILL_SLOTS - 1); tpp = &tcp_tw_death_row[slot]; } else { - tw->ttd = jiffies + (slot<ttd = jiffies + (slot< (slot< (slot<probes == ifp->idev->cnf.rtr_solicits) ? - ifp->idev->cnf.rtr_solicit_delay : - ifp->idev->cnf.rtr_solicit_interval); + user_to_kernel_hz_overflow(ifp->idev->cnf.__rtr_solicit_delay) : + user_to_kernel_hz_overflow(ifp->idev->cnf.__rtr_solicit_interval)); spin_unlock(&ifp->lock); ipv6_addr_all_routers(&all_routers); @@ -1615,7 +1615,7 @@ static void addrconf_dad_start(struct in addrconf_prefix_route(&ifp->addr, ifp->prefix_len, dev, 0, flags); net_srandom(ifp->addr.s6_addr32[3]); - rand_num = net_random() % (ifp->idev->cnf.rtr_solicit_delay ? : 1); + rand_num = net_random() % (user_to_kernel_hz_overflow(ifp->idev->cnf.__rtr_solicit_delay) ? : 1); spin_lock_bh(&ifp->lock); @@ -1698,7 +1698,7 @@ static void addrconf_dad_completed(struc spin_lock_bh(&ifp->lock); ifp->probes = 1; ifp->idev->if_flags |= IF_RS_SENT; - addrconf_mod_timer(ifp, AC_RS, ifp->idev->cnf.rtr_solicit_interval); + addrconf_mod_timer(ifp, AC_RS, user_to_kernel_hz_overflow(ifp->idev->cnf.__rtr_solicit_interval)); spin_unlock_bh(&ifp->lock); } @@ -2197,11 +2197,11 @@ static struct addrconf_sysctl_table &proc_dointvec}, {NET_IPV6_RTR_SOLICIT_INTERVAL, "router_solicitation_interval", - &ipv6_devconf.rtr_solicit_interval, sizeof(int), 0644, NULL, + &ipv6_devconf.__rtr_solicit_interval, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, {NET_IPV6_RTR_SOLICIT_DELAY, "router_solicitation_delay", - &ipv6_devconf.rtr_solicit_delay, sizeof(int), 0644, NULL, + &ipv6_devconf.__rtr_solicit_delay, sizeof(int), 0644, NULL, &proc_dointvec_jiffies}, {0}}, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv6/icmp.c xx/net/ipv6/icmp.c --- x-ref/net/ipv6/icmp.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/ipv6/icmp.c 2003-10-02 15:15:49.000000000 +0200 @@ -192,7 +192,8 @@ static int is_ineligible(struct sk_buff return 0; } -int sysctl_icmpv6_time = 1*HZ; +int __sysctl_icmpv6_time = 1*USER_HZ; +#define sysctl_icmpv6_time user_to_kernel_hz_overflow(__sysctl_icmpv6_time) /* * Check the ICMP output rate limit @@ -720,7 +721,7 @@ int icmpv6_err_convert(int type, int cod #ifdef CONFIG_SYSCTL ctl_table ipv6_icmp_table[] = { {NET_IPV6_ICMP_RATELIMIT, "ratelimit", - &sysctl_icmpv6_time, sizeof(int), 0644, NULL, &proc_dointvec}, + &__sysctl_icmpv6_time, sizeof(int), 0644, NULL, &proc_dointvec}, {0}, }; #endif diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv6/ndisc.c xx/net/ipv6/ndisc.c --- x-ref/net/ipv6/ndisc.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/ipv6/ndisc.c 2003-10-02 15:15:49.000000000 +0200 @@ -134,8 +134,8 @@ struct neigh_table nd_tbl = pndisc_redo, "ndisc_cache", { NULL, NULL, &nd_tbl, 0, NULL, NULL, - 30*HZ, 1*HZ, 60*HZ, 30*HZ, 5*HZ, 3, 3, 0, 3, 1*HZ, (8*HZ)/10, 64, 0 }, - 30*HZ, 128, 512, 1024, + 30*USER_HZ, 1*USER_HZ, 60*USER_HZ, 30*USER_HZ, 5*USER_HZ, 3, 3, 0, 3, 1*USER_HZ, (8*USER_HZ)/10, 64, 0 }, + 30*USER_HZ, 128, 512, 1024, }; #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv6/reassembly.c xx/net/ipv6/reassembly.c --- x-ref/net/ipv6/reassembly.c 2003-08-26 00:13:18.000000000 +0200 +++ xx/net/ipv6/reassembly.c 2003-10-02 15:15:49.000000000 +0200 @@ -53,7 +53,8 @@ int sysctl_ip6frag_high_thresh = 256*1024; int sysctl_ip6frag_low_thresh = 192*1024; -int sysctl_ip6frag_time = IPV6_FRAG_TIMEOUT; +int __sysctl_ip6frag_time = IPV6_FRAG_TIMEOUT; +#define sysctl_ip6frag_time user_to_kernel_hz_overflow(__sysctl_ip6frag_time) struct ip6frag_skb_cb { @@ -148,7 +149,8 @@ static unsigned int ip6qhashfn(u32 id, s } static struct timer_list ip6_frag_secret_timer; -static int ip6_frag_secret_interval = 10 * 60 * HZ; +static int __ip6_frag_secret_interval = 10 * 60 * USER_HZ; +#define ip6_frag_secret_interval user_to_kernel_hz_overflow(__ip6_frag_secret_interval) static void ip6_frag_secret_rebuild(unsigned long dummy) { diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/ipv6/route.c xx/net/ipv6/route.c --- x-ref/net/ipv6/route.c 2003-10-02 00:09:47.000000000 +0200 +++ xx/net/ipv6/route.c 2003-10-02 15:15:49.000000000 +0200 @@ -71,13 +71,17 @@ int ip6_rt_max_size = 4096; -int ip6_rt_gc_min_interval = HZ / 2; -int ip6_rt_gc_timeout = 60*HZ; -int ip6_rt_gc_interval = 30*HZ; +int __ip6_rt_gc_min_interval = USER_HZ / 2; +int __ip6_rt_gc_timeout = 60*USER_HZ; +int __ip6_rt_gc_interval = 30*USER_HZ; int ip6_rt_gc_elasticity = 9; -int ip6_rt_mtu_expires = 10*60*HZ; +int __ip6_rt_mtu_expires = 10*60*USER_HZ; int ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40; +#define ip6_rt_gc_min_interval user_to_kernel_hz_overflow(__ip6_rt_gc_min_interval) +#define ip6_rt_gc_timeout user_to_kernel_hz_overflow(__ip6_rt_gc_timeout) +#define ip6_rt_mtu_expires user_to_kernel_hz_overflow(__ip6_rt_mtu_expires) + static struct rt6_info * ip6_rt_copy(struct rt6_info *ort); static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie); static struct dst_entry *ip6_dst_reroute(struct dst_entry *dst, @@ -644,7 +648,7 @@ static void ip6_link_failure(struct sk_b static int ip6_dst_gc() { - static unsigned expire = 30*HZ; + static unsigned expire = 30*USER_HZ; static unsigned long last_gc; unsigned long now = jiffies; @@ -653,10 +657,10 @@ static int ip6_dst_gc() goto out; expire++; - fib6_run_gc(expire); + fib6_run_gc(user_to_kernel_hz_overflow(expire)); last_gc = now; if (atomic_read(&ip6_dst_ops.entries) < ip6_dst_ops.gc_thresh) - expire = ip6_rt_gc_timeout>>1; + expire = __ip6_rt_gc_timeout>>1; out: expire -= expire>>ip6_rt_gc_elasticity; @@ -2021,19 +2025,19 @@ ctl_table ipv6_route_table[] = { &ip6_rt_max_size, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_IPV6_ROUTE_GC_MIN_INTERVAL, "gc_min_interval", - &ip6_rt_gc_min_interval, sizeof(int), 0644, NULL, + &__ip6_rt_gc_min_interval, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, {NET_IPV6_ROUTE_GC_TIMEOUT, "gc_timeout", - &ip6_rt_gc_timeout, sizeof(int), 0644, NULL, + &__ip6_rt_gc_timeout, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, {NET_IPV6_ROUTE_GC_INTERVAL, "gc_interval", - &ip6_rt_gc_interval, sizeof(int), 0644, NULL, + &__ip6_rt_gc_interval, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, {NET_IPV6_ROUTE_GC_ELASTICITY, "gc_elasticity", &ip6_rt_gc_elasticity, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, {NET_IPV6_ROUTE_MTU_EXPIRES, "mtu_expires", - &ip6_rt_mtu_expires, sizeof(int), 0644, NULL, + &__ip6_rt_mtu_expires, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies}, {NET_IPV6_ROUTE_MIN_ADVMSS, "min_adv_mss", &ip6_rt_min_advmss, sizeof(int), 0644, NULL, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/irda/irlap.c xx/net/irda/irlap.c --- x-ref/net/irda/irlap.c 2003-06-13 22:07:42.000000000 +0200 +++ xx/net/irda/irlap.c 2003-10-02 15:15:49.000000000 +0200 @@ -49,7 +49,7 @@ #include hashbin_t *irlap = NULL; -int sysctl_slot_timeout = SLOT_TIMEOUT * 1000 / HZ; +int sysctl_slot_timeout = SLOT_TIMEOUT; /* This is the delay of missed pf period before generating an event * to the application. The spec mandate 3 seconds, but in some cases diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/irda/irlmp.c xx/net/irda/irlmp.c --- x-ref/net/irda/irlmp.c 2003-06-13 22:07:42.000000000 +0200 +++ xx/net/irda/irlmp.c 2003-10-02 15:15:49.000000000 +0200 @@ -50,7 +50,7 @@ struct irlmp_cb *irlmp = NULL; int sysctl_discovery = 0; int sysctl_discovery_timeout = 3; /* 3 seconds by default */ int sysctl_discovery_slots = 6; /* 6 slots by default */ -int sysctl_lap_keepalive_time = LM_IDLE_TIMEOUT * 1000 / HZ; +int sysctl_lap_keepalive_time = LM_IDLE_TIMEOUT * 1000; char sysctl_devname[65]; char *lmp_reasons[] = { diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/irda/irlmp_event.c xx/net/irda/irlmp_event.c --- x-ref/net/irda/irlmp_event.c 2003-08-26 00:13:18.000000000 +0200 +++ xx/net/irda/irlmp_event.c 2003-10-02 15:15:49.000000000 +0200 @@ -298,7 +298,7 @@ static void irlmp_state_u_connect(struct * forever in LAP_ACTIVE state - Jean II */ if (HASHBIN_GET_SIZE(self->lsaps) == 0) { IRDA_DEBUG(0, "%s() NO LSAPs !\n", __FUNCTION__); - irlmp_start_idle_timer(self, LM_IDLE_TIMEOUT); + irlmp_start_idle_timer(self, LM_IDLE_TIMEOUT * HZ); } break; case LM_LAP_CONNECT_REQUEST: @@ -318,7 +318,7 @@ static void irlmp_state_u_connect(struct * forever in LAP_ACTIVE state - Jean II */ if (HASHBIN_GET_SIZE(self->lsaps) == 0) { IRDA_DEBUG(0, "%s() NO LSAPs !\n", __FUNCTION__); - irlmp_start_idle_timer(self, LM_IDLE_TIMEOUT); + irlmp_start_idle_timer(self, LM_IDLE_TIMEOUT * HZ); } break; case LM_LAP_DISCONNECT_INDICATION: diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/netrom/af_netrom.c xx/net/netrom/af_netrom.c --- x-ref/net/netrom/af_netrom.c 2003-03-15 03:25:19.000000000 +0100 +++ xx/net/netrom/af_netrom.c 2003-10-02 15:15:49.000000000 +0200 @@ -73,15 +73,20 @@ int nr_ndevs = 4; int sysctl_netrom_default_path_quality = NR_DEFAULT_QUAL; int sysctl_netrom_obsolescence_count_initialiser = NR_DEFAULT_OBS; int sysctl_netrom_network_ttl_initialiser = NR_DEFAULT_TTL; -int sysctl_netrom_transport_timeout = NR_DEFAULT_T1; +int __sysctl_netrom_transport_timeout = NR_DEFAULT_T1; int sysctl_netrom_transport_maximum_tries = NR_DEFAULT_N2; -int sysctl_netrom_transport_acknowledge_delay = NR_DEFAULT_T2; -int sysctl_netrom_transport_busy_delay = NR_DEFAULT_T4; +int __sysctl_netrom_transport_acknowledge_delay = NR_DEFAULT_T2; +int __sysctl_netrom_transport_busy_delay = NR_DEFAULT_T4; int sysctl_netrom_transport_requested_window_size = NR_DEFAULT_WINDOW; -int sysctl_netrom_transport_no_activity_timeout = NR_DEFAULT_IDLE; +int __sysctl_netrom_transport_no_activity_timeout = NR_DEFAULT_IDLE; int sysctl_netrom_routing_control = NR_DEFAULT_ROUTING; int sysctl_netrom_link_fails_count = NR_DEFAULT_FAILS; +#define sysctl_netrom_transport_timeout user_to_kernel_hz_overflow(__sysctl_netrom_transport_timeout) +#define sysctl_netrom_transport_acknowledge_delay user_to_kernel_hz_overflow(__sysctl_netrom_transport_acknowledge_delay) +#define sysctl_netrom_transport_busy_delay user_to_kernel_hz_overflow(__sysctl_netrom_transport_busy_delay) +#define sysctl_netrom_transport_no_activity_timeout user_to_kernel_hz_overflow(__sysctl_netrom_transport_no_activity_timeout) + static unsigned short circuit = 0x101; static struct sock *volatile nr_list; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/netrom/sysctl_net_netrom.c xx/net/netrom/sysctl_net_netrom.c --- x-ref/net/netrom/sysctl_net_netrom.c 2003-03-15 03:25:19.000000000 +0100 +++ xx/net/netrom/sysctl_net_netrom.c 2003-10-02 15:15:49.000000000 +0200 @@ -17,16 +17,16 @@ static int min_quality[] = {0}, max_quality[] = {255}; static int min_obs[] = {0}, max_obs[] = {255}; static int min_ttl[] = {0}, max_ttl[] = {255}; -static int min_t1[] = {5 * HZ}; -static int max_t1[] = {600 * HZ}; +static int min_t1[] = {5 * USER_HZ}; +static int max_t1[] = {600 * USER_HZ}; static int min_n2[] = {2}, max_n2[] = {127}; -static int min_t2[] = {1 * HZ}; -static int max_t2[] = {60 * HZ}; -static int min_t4[] = {1 * HZ}; -static int max_t4[] = {1000 * HZ}; +static int min_t2[] = {1 * USER_HZ}; +static int max_t2[] = {60 * USER_HZ}; +static int min_t4[] = {1 * USER_HZ}; +static int max_t4[] = {1000 * USER_HZ}; static int min_window[] = {1}, max_window[] = {127}; -static int min_idle[] = {0 * HZ}; -static int max_idle[] = {65535 * HZ}; +static int min_idle[] = {0 * USER_HZ}; +static int max_idle[] = {65535 * USER_HZ}; static int min_route[] = {0}, max_route[] = {1}; static int min_fails[] = {1}, max_fails[] = {10}; @@ -43,22 +43,22 @@ static ctl_table nr_table[] = { &sysctl_netrom_network_ttl_initialiser, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_ttl, &max_ttl}, {NET_NETROM_TRANSPORT_TIMEOUT, "transport_timeout", - &sysctl_netrom_transport_timeout, sizeof(int), 0644, NULL, + &__sysctl_netrom_transport_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_t1, &max_t1}, {NET_NETROM_TRANSPORT_MAXIMUM_TRIES, "transport_maximum_tries", &sysctl_netrom_transport_maximum_tries, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_n2, &max_n2}, {NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY, "transport_acknowledge_delay", - &sysctl_netrom_transport_acknowledge_delay, sizeof(int), 0644, NULL, + &__sysctl_netrom_transport_acknowledge_delay, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_t2, &max_t2}, {NET_NETROM_TRANSPORT_BUSY_DELAY, "transport_busy_delay", - &sysctl_netrom_transport_busy_delay, sizeof(int), 0644, NULL, + &__sysctl_netrom_transport_busy_delay, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_t4, &max_t4}, {NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE, "transport_requested_window_size", &sysctl_netrom_transport_requested_window_size, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_window, &max_window}, {NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT, "transport_no_activity_timeout", - &sysctl_netrom_transport_no_activity_timeout, sizeof(int), 0644, NULL, + &__sysctl_netrom_transport_no_activity_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_idle, &max_idle}, {NET_NETROM_ROUTING_CONTROL, "routing_control", &sysctl_netrom_routing_control, sizeof(int), 0644, NULL, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/rose/af_rose.c xx/net/rose/af_rose.c --- x-ref/net/rose/af_rose.c 2003-08-26 00:13:18.000000000 +0200 +++ xx/net/rose/af_rose.c 2003-10-02 15:15:49.000000000 +0200 @@ -64,14 +64,14 @@ int rose_ndevs = 10; -int sysctl_rose_restart_request_timeout = ROSE_DEFAULT_T0; -int sysctl_rose_call_request_timeout = ROSE_DEFAULT_T1; -int sysctl_rose_reset_request_timeout = ROSE_DEFAULT_T2; -int sysctl_rose_clear_request_timeout = ROSE_DEFAULT_T3; -int sysctl_rose_no_activity_timeout = ROSE_DEFAULT_IDLE; -int sysctl_rose_ack_hold_back_timeout = ROSE_DEFAULT_HB; +int __sysctl_rose_restart_request_timeout = ROSE_DEFAULT_T0; +int __sysctl_rose_call_request_timeout = ROSE_DEFAULT_T1; +int __sysctl_rose_reset_request_timeout = ROSE_DEFAULT_T2; +int __sysctl_rose_clear_request_timeout = ROSE_DEFAULT_T3; +int __sysctl_rose_no_activity_timeout = ROSE_DEFAULT_IDLE; +int __sysctl_rose_ack_hold_back_timeout = ROSE_DEFAULT_HB; int sysctl_rose_routing_control = ROSE_DEFAULT_ROUTING; -int sysctl_rose_link_fail_timeout = ROSE_DEFAULT_FAIL_TIMEOUT; +int __sysctl_rose_link_fail_timeout = ROSE_DEFAULT_FAIL_TIMEOUT; int sysctl_rose_maximum_vcs = ROSE_DEFAULT_MAXVC; int sysctl_rose_window_size = ROSE_DEFAULT_WINDOW_SIZE; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/rose/sysctl_net_rose.c xx/net/rose/sysctl_net_rose.c --- x-ref/net/rose/sysctl_net_rose.c 2003-03-15 03:25:19.000000000 +0100 +++ xx/net/rose/sysctl_net_rose.c 2003-10-02 15:15:49.000000000 +0200 @@ -11,13 +11,13 @@ #include #include -static int min_timer[] = {1 * HZ}; -static int max_timer[] = {300 * HZ}; -static int min_idle[] = {0 * HZ}; -static int max_idle[] = {65535 * HZ}; +static int min_timer[] = {1 * USER_HZ}; +static int max_timer[] = {300 * USER_HZ}; +static int min_idle[] = {0 * USER_HZ}; +static int max_idle[] = {65535 * USER_HZ}; static int min_route[] = {0}, max_route[] = {1}; -static int min_ftimer[] = {60 * HZ}; -static int max_ftimer[] = {600 * HZ}; +static int min_ftimer[] = {60 * USER_HZ}; +static int max_ftimer[] = {600 * USER_HZ}; static int min_maxvcs[] = {1}, max_maxvcs[] = {254}; static int min_window[] = {1}, max_window[] = {7}; @@ -25,28 +25,28 @@ static struct ctl_table_header *rose_tab static ctl_table rose_table[] = { {NET_ROSE_RESTART_REQUEST_TIMEOUT, "restart_request_timeout", - &sysctl_rose_restart_request_timeout, sizeof(int), 0644, NULL, + &__sysctl_rose_restart_request_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {NET_ROSE_CALL_REQUEST_TIMEOUT, "call_request_timeout", - &sysctl_rose_call_request_timeout, sizeof(int), 0644, NULL, + &__sysctl_rose_call_request_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {NET_ROSE_RESET_REQUEST_TIMEOUT, "reset_request_timeout", - &sysctl_rose_reset_request_timeout, sizeof(int), 0644, NULL, + &__sysctl_rose_reset_request_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {NET_ROSE_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout", - &sysctl_rose_clear_request_timeout, sizeof(int), 0644, NULL, + &__sysctl_rose_clear_request_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {NET_ROSE_NO_ACTIVITY_TIMEOUT, "no_activity_timeout", - &sysctl_rose_no_activity_timeout, sizeof(int), 0644, NULL, + &__sysctl_rose_no_activity_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_idle, &max_idle}, {NET_ROSE_ACK_HOLD_BACK_TIMEOUT, "acknowledge_hold_back_timeout", - &sysctl_rose_ack_hold_back_timeout, sizeof(int), 0644, NULL, + &__sysctl_rose_ack_hold_back_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {NET_ROSE_ROUTING_CONTROL, "routing_control", &sysctl_rose_routing_control, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_route, &max_route}, {NET_ROSE_LINK_FAIL_TIMEOUT, "link_fail_timeout", - &sysctl_rose_link_fail_timeout, sizeof(int), 0644, NULL, + &__sysctl_rose_link_fail_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_ftimer, &max_ftimer}, {NET_ROSE_MAX_VCS, "maximum_virtual_circuits", &sysctl_rose_maximum_vcs, sizeof(int), 0644, NULL, diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/sched/estimator.c xx/net/sched/estimator.c --- x-ref/net/sched/estimator.c 2003-03-15 03:25:19.000000000 +0100 +++ xx/net/sched/estimator.c 2003-10-02 15:15:49.000000000 +0200 @@ -71,10 +71,6 @@ at user level painlessly. */ -#if (HZ%4) != 0 -#error Bad HZ value. -#endif - #define EST_MAX_INTERVAL 5 struct qdisc_estimator @@ -136,6 +132,9 @@ int qdisc_new_estimator(struct tc_stats struct qdisc_estimator *est; struct tc_estimator *parm = RTA_DATA(opt); + if (unlikely(HZ % 4)) + return -EINVAL; + if (RTA_PAYLOAD(opt) < sizeof(*parm)) return -EINVAL; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/sched/sch_api.c xx/net/sched/sch_api.c --- x-ref/net/sched/sch_api.c 2003-03-15 03:25:19.000000000 +0100 +++ xx/net/sched/sch_api.c 2003-10-02 15:15:49.000000000 +0200 @@ -1117,7 +1117,7 @@ static void psched_tick(unsigned long du psched_timer.expires = jiffies + 1*HZ; #else unsigned long now = jiffies; - psched_time_base += ((u64)(now-psched_time_mark))< #include -int sysctl_x25_restart_request_timeout = X25_DEFAULT_T20; -int sysctl_x25_call_request_timeout = X25_DEFAULT_T21; -int sysctl_x25_reset_request_timeout = X25_DEFAULT_T22; -int sysctl_x25_clear_request_timeout = X25_DEFAULT_T23; -int sysctl_x25_ack_holdback_timeout = X25_DEFAULT_T2; +int __sysctl_x25_restart_request_timeout = X25_DEFAULT_T20; +int __sysctl_x25_call_request_timeout = X25_DEFAULT_T21; +int __sysctl_x25_reset_request_timeout = X25_DEFAULT_T22; +int __sysctl_x25_clear_request_timeout = X25_DEFAULT_T23; +int __sysctl_x25_ack_holdback_timeout = X25_DEFAULT_T2; static struct sock *volatile x25_list /* = NULL initially */; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/net/x25/sysctl_net_x25.c xx/net/x25/sysctl_net_x25.c --- x-ref/net/x25/sysctl_net_x25.c 2003-03-15 03:25:20.000000000 +0100 +++ xx/net/x25/sysctl_net_x25.c 2003-10-02 15:15:49.000000000 +0200 @@ -13,26 +13,26 @@ #include #include -static int min_timer[] = {1 * HZ}; -static int max_timer[] = {300 * HZ}; +static int min_timer[] = {1 * USER_HZ}; +static int max_timer[] = {300 * USER_HZ}; static struct ctl_table_header *x25_table_header; static ctl_table x25_table[] = { {NET_X25_RESTART_REQUEST_TIMEOUT, "restart_request_timeout", - &sysctl_x25_restart_request_timeout, sizeof(int), 0644, NULL, + &__sysctl_x25_restart_request_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {NET_X25_CALL_REQUEST_TIMEOUT, "call_request_timeout", - &sysctl_x25_call_request_timeout, sizeof(int), 0644, NULL, + &__sysctl_x25_call_request_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {NET_X25_RESET_REQUEST_TIMEOUT, "reset_request_timeout", - &sysctl_x25_reset_request_timeout, sizeof(int), 0644, NULL, + &__sysctl_x25_reset_request_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {NET_X25_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout", - &sysctl_x25_clear_request_timeout, sizeof(int), 0644, NULL, + &__sysctl_x25_clear_request_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {NET_X25_ACK_HOLD_BACK_TIMEOUT, "acknowledgement_hold_back_timeout", - &sysctl_x25_ack_holdback_timeout, sizeof(int), 0644, NULL, + &__sysctl_x25_ack_holdback_timeout, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &min_timer, &max_timer}, {0} };