--- linux/include/asm-i386/param.h.orig Thu Nov 12 14:35:23 1998 +++ linux/include/asm-i386/param.h Wed Feb 3 19:57:35 1999 @@ -1,8 +1,16 @@ #ifndef _ASMi386_PARAM_H #define _ASMi386_PARAM_H +#include + #ifndef HZ -#define HZ 100 +# ifdef CONFIG_X86_HZ400 +# define HZ 400 +# define HZ_TO_STD 4 +# else +# define HZ 100 +# define HZ_TO_STD 1 +# endif #endif #define EXEC_PAGESIZE 4096 --- linux/kernel/sys.c.orig Fri Nov 20 20:43:19 1998 +++ linux/kernel/sys.c Wed Feb 3 14:40:49 1999 @@ -602,6 +602,10 @@ return old_fsgid; } +#ifndef HZ_TO_STD +# define HZ_TO_STD 1 +#endif + asmlinkage long sys_times(struct tms * tbuf) { /* @@ -610,10 +614,15 @@ * atomically safe type this is just fine. Conceptually its * as if the syscall took an instant longer to occur. */ - if (tbuf) + if (tbuf) { if (copy_to_user(tbuf, ¤t->times, sizeof(struct tms))) return -EFAULT; - return jiffies; + tbuf->tms_utime /= HZ_TO_STD; + tbuf->tms_stime /= HZ_TO_STD; + tbuf->tms_cutime /= HZ_TO_STD; + tbuf->tms_cstime /= HZ_TO_STD; + }; + return jiffies /* / HZ_TO_STD*/; } /* --- linux/fs/proc/array.c.orig Wed Feb 3 10:50:47 1999 +++ linux/fs/proc/array.c Wed Feb 3 14:41:38 1999 @@ -226,6 +226,10 @@ nr_running, nr_tasks, last_pid); } +#ifndef HZ_TO_STD +# define HZ_TO_STD 1 +#endif + static int get_kstat(char * buffer) { int i, len; @@ -233,26 +237,26 @@ extern unsigned long total_forks; unsigned long ticks; - ticks = jiffies * smp_num_cpus; + ticks = jiffies * smp_num_cpus / HZ_TO_STD; for (i = 0 ; i < NR_IRQS ; i++) sum += kstat_irqs(i); #ifdef __SMP__ len = sprintf(buffer, "cpu %u %u %u %lu\n", - kstat.cpu_user, - kstat.cpu_nice, - kstat.cpu_system, - jiffies*smp_num_cpus - (kstat.cpu_user + kstat.cpu_nice + kstat.cpu_system)); + kstat.cpu_user/HZ_TO_STD, + kstat.cpu_nice/HZ_TO_STD, + kstat.cpu_system/HZ_TO_STD, + ticks - ((kstat.cpu_user + kstat.cpu_nice + kstat.cpu_system))/HZ_TO_STD); for (i = 0 ; i < smp_num_cpus; i++) len += sprintf(buffer + 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)], - jiffies - ( kstat.per_cpu_user[cpu_logical_map(i)] \ + kstat.per_cpu_user[cpu_logical_map(i)]/HZ_TO_STD, + kstat.per_cpu_nice[cpu_logical_map(i)]/HZ_TO_STD, + kstat.per_cpu_system[cpu_logical_map(i)]/HZ_TO_STD, + (jiffies - ( kstat.per_cpu_user[cpu_logical_map(i)] \ + kstat.per_cpu_nice[cpu_logical_map(i)] \ - + kstat.per_cpu_system[cpu_logical_map(i)])); + + kstat.per_cpu_system[cpu_logical_map(i)]))/HZ_TO_STD); len += sprintf(buffer + len, "disk %u %u %u %u\n" "disk_rio %u %u %u %u\n" @@ -273,10 +277,10 @@ "page %u %u\n" "swap %u %u\n" "intr %u", - kstat.cpu_user, - kstat.cpu_nice, - kstat.cpu_system, - ticks - (kstat.cpu_user + kstat.cpu_nice + kstat.cpu_system), + kstat.cpu_user/HZ_TO_STD, + kstat.cpu_nice/HZ_TO_STD, + kstat.cpu_system/HZ_TO_STD, + ticks - ((kstat.cpu_user + kstat.cpu_nice + kstat.cpu_system)/HZ_TO_STD), #endif kstat.dk_drive[0], kstat.dk_drive[1], kstat.dk_drive[2], kstat.dk_drive[3], @@ -894,10 +898,10 @@ tsk->cmin_flt, tsk->maj_flt, tsk->cmaj_flt, - tsk->times.tms_utime, - tsk->times.tms_stime, - tsk->times.tms_cutime, - tsk->times.tms_cstime, + tsk->times.tms_utime/HZ_TO_STD, + tsk->times.tms_stime/HZ_TO_STD, + tsk->times.tms_cutime/HZ_TO_STD, + tsk->times.tms_cstime/HZ_TO_STD, priority, nice, 0UL /* removed */, @@ -1212,14 +1216,14 @@ len = sprintf(buffer, "cpu %lu %lu\n", - tsk->times.tms_utime, - tsk->times.tms_stime); + tsk->times.tms_utime/HZ_TO_STD, + tsk->times.tms_stime/HZ_TO_STD); for (i = 0 ; i < smp_num_cpus; i++) len += sprintf(buffer + len, "cpu%d %lu %lu\n", i, - tsk->per_cpu_utime[cpu_logical_map(i)], - tsk->per_cpu_stime[cpu_logical_map(i)]); + tsk->per_cpu_utime[cpu_logical_map(i)]/HZ_TO_STD, + tsk->per_cpu_stime[cpu_logical_map(i)]/HZ_TO_STD); return len; } --- linux/arch/i386/config.in.orig Wed Feb 3 11:37:18 1999 +++ linux/arch/i386/config.in Wed Feb 3 14:57:33 1999 @@ -36,6 +36,7 @@ bool 'Math emulation' CONFIG_MATH_EMULATION bool 'MTRR (Memory Type Range Register) support' CONFIG_MTRR bool 'Symmetric multi-processing support' CONFIG_SMP +bool 'Set HZ to 400 (instead of 100)' CONFIG_X86_HZ400 endmenu mainmenu_option next_comment --- linux/Documentation/Configure.help.orig Wed Feb 3 11:37:18 1999 +++ linux/Documentation/Configure.help Wed Feb 3 15:02:25 1999 @@ -1736,6 +1736,17 @@ If you don't know what to do, choose "386". +HZ=400 on ix86 machines +CONFIG_i386_HZ400 + This increases the frequency of the timer interrupt and thus the + scheduler will run more often. This might result in slightly lower + latencies for processes to be woken up. Userspace applications will see + times in units of 100Hz, so it's fully transparent. + + Not recommended on slow CPUs (<=486) because of the scheduler overhead. + + If unsure, say N + VGA text console CONFIG_VGA_CONSOLE Saying Y here will allow you to use Linux in text mode through a