diff -urN oldtree/include/linux/sysctl.h newtree/include/linux/sysctl.h --- oldtree/include/linux/sysctl.h 2006-09-29 14:59:47.000000000 -0400 +++ newtree/include/linux/sysctl.h 2006-09-29 15:01:07.000000000 -0400 @@ -155,6 +155,8 @@ KERN_INTERACTIVE=77, /* interactive tasks can have cpu bursts */ KERN_COMPUTE=78, /* adjust timeslices for a compute server */ KERN_ISO_CPU=79, /* percent cpu SCHED_ISO tasks run SCHED_RR */ + KERN_STRCS_RR_SLICE=80, /* alter value of min RR slice */ + KERN_STRCS_RR_FACTOR=81, /* factor for default RR slice */ }; diff -urN oldtree/init/Kconfig newtree/init/Kconfig --- oldtree/init/Kconfig 2006-09-29 14:23:13.000000000 -0400 +++ newtree/init/Kconfig 2006-09-29 15:01:07.000000000 -0400 @@ -79,7 +79,9 @@ help This scheduler is an O(1) single priority array with a foreground- background interactive design. (default in no-sources) + endchoice +source "init/Kconfig.staircase" endmenu menu "General setup" diff -urN oldtree/init/Kconfig.staircase newtree/init/Kconfig.staircase --- oldtree/init/Kconfig.staircase 1969-12-31 19:00:00.000000000 -0500 +++ newtree/init/Kconfig.staircase 2006-09-29 15:01:07.000000000 -0400 @@ -0,0 +1,217 @@ +menu "Staircase Tunable Options" +choice + prompt "Staircase Kernel Tunable Preset: " + default STAIRCASE_DESKTOP + +config STAIRCASE_SERVER + bool "Server" + ---help--- + Best setting for servers. + + Setting: + sched_interactive = 0; + sched_compute = 0; + sched_iso_cpu = 0; + vm_mapped = 33; + vm_hardmaplimit = 0; + vm_tail_largefiles = 0; + vm_dirty_ratio = 66; + staircase_rr_slice = 6 + staircase_rr_factor = 19 + + config STAIRCASE_FILE_SERVER + bool "File Server" + ---help--- + Best setting for file servers. + + Setting: + sched_interactive = 0; + sched_compute = 0; + sched_iso_cpu = 0; + vm_mapped = 0; + vm_hardmaplimit = 0; + vm_tail_largefiles = 0; + vm_dirty_ratio = 66; + staircase_rr_slice = 6 + staircase_rr_factor = 19 + +config STAIRCASE_COMPUTE_SERVER + bool "Compute Server" + ---help--- + Best setting for compute servers. + + Setting: + sched_interactive = 0; + sched_compute = 1; + sched_iso_cpu = 0; + vm_mapped = 0; + vm_hardmaplimit = 0; + vm_tail_largefiles = 0; + vm_dirty_ratio = 66; + staircase_rr_slice = 6 + staircase_rr_factor = 19 + +config STAIRCASE_GAMING + bool "Gaming" + ---help--- + Best setting for strict gaming. + + Setting: + sched_interactive = 0; + sched_compute = 1; + sched_iso_cpu = 0; + vm_mapped = 33; + vm_hardmaplimit = 0; + vm_tail_largefiles = 0; + vm_dirty_ratio = 66; + staircase_rr_slice = 6 + staircase_rr_factor = 19 + +config STAIRCASE_DESKTOP + bool "Desktop" + ---help--- + Best setting for desktops. + + Setting: + sched_interactive = 1; + sched_compute = 0; + sched_iso_cpu = 80; + vm_mapped = 66; + vm_hardmaplimit = 1; + vm_tail_largefiles = 0; + vm_dirty_ratio = 0; + staircase_rr_slice = 6 + staircase_rr_factor = 19 + +config STAIRCASE_LL_DESKTOP + bool "Low Latency Desktop" + ---help--- + Best setting for lower latency desktops. + + Setting: + sched_interactive = 1; + sched_compute = 0; + sched_iso_cpu = 80; + vm_mapped = 66; + vm_hardmaplimit = 0; + vm_tail_largefiles = 0; + vm_dirty_ratio = 0; + staircase_rr_slice = 3 + staircase_rr_factor = 11 + +config STAIRCASE_CUSTOM + bool "Custom" +endchoice + +config STAIRCASE_RR_SLICE + depends on STAIRCASE_CUSTOM + int "Minimum Round Robin Timeslice (in milliseconds)" + range 2 50 + default 6 + ---help--- + This is the time all tasks within the same priority round robin. + Here we set the minimum value. + + Select '6' for default Staircase options. + +config STAIRCASE_RR_FACTOR + depends on STAIRCASE_CUSTOM + int "Factor For Default Value" + range 2 50 + default 19 + ---help--- + Factor For Default Value * Minimum Round Robin Timeslice + = Default Timeslice. + + Select '19' for default Staircase options. + +config SCHED_INTERACTIVE_SETTING + depends on STAIRCASE_CUSTOM + int "Interactive CPU Scheduling" + range 0 1 + default 1 + ---help--- + This is the interactive tunable for the staircase cpu scheduler. The default + behaviour is for nice value to determine cpu proportion only, and wakeup + latency is determined by the percentage of the cpu entitlement of a task. The + interactive tunable modifies this behaviour such that nice value determines + both cpu proportion and wakeup latency. + + Value is either '1' or '0' (Enable/Disable). + +config SCHED_COMPUTE_SETTING + depends on STAIRCASE_CUSTOM + int "Compute CPU Scheduling" + range 0 1 + default 0 + ---help--- + This setting makes round robin intervals much longer, delays task preemption + and disables interactive mode to optimise cpu cache usage - suitable for + computational intensive tasks. Enabling compute mode ignores the value of + interactive. It is not recommended to use compute mode if there is significant + network traffic or other workload that requires low latencies as it has extremely + bad latencies (intentionally). It is best suited to machines that do mainly cpu + work and very little I/O (eg rendering). + + Value is either '1' or '0' (Enable/Disable). + +config SCHED_ISO_CPU_SETTING + depends on STAIRCASE_CUSTOM + int "Percentage CPU For SCHED_ISO Tasks" + range 0 100 + default 80 + ---help--- + This sets the percentage cpu that the unprivileged SCHED_ISO tasks can + run effectively at realtime priority, averaged over a rolling 3 seconds. + + Select '80' for default CK option. + +config VM_MAPPED_SETTING + depends on STAIRCASE_CUSTOM + int "Percentage RAM Filled With Mapped Pages" + range 0 100 + default 66 + ---help--- + This is the percentage ram that is filled with mapped pages (applications) + before the vm will start reclaiming mapped pages by moving them to swap. + It is altered by the relative stress of the vm at the time so is not + strictly adhered to to prevent provoking out of memory kills. + + Select '66' for default CK option. + +config VM_HARDMAPLIMIT_SETTING + depends on STAIRCASE_CUSTOM + int "Hard Mapped Limit" + range 0 1 + default 1 + ---help--- + This flag makes the vm adhere to the mapped value as closely as possible + except in the most extreme vm stress where doing so would provoke an out + of memory condition. + + + Value is either '1' or '0' (Enable/Disable). + +config VM_TAIL_LARGEFILES_SETTING + depends on STAIRCASE_CUSTOM + int "Tail Large Files" + range 0 1 + default 1 + ---help--- + When enabled reads from large files to the tail end of the inactive lru list. + This means that any cache from reading large files is dropped very quickly, + preventing loss of mapped ram and useful pagecache when large files are read. + This does, however, make caching less effective when working with large files. + + Value is either '1' or '0' (Enable/Disable). + +config VM_DIRTY_RATIO_SETTING + depends on STAIRCASE_CUSTOM + int "Dirty Ratio" + range 0 100 + default 0 + ---help--- + The generator of dirty data starts writeback at this percentage. + + Select '0' for default CK option. +endmenu diff -urN oldtree/kernel/sched_staircase.c newtree/kernel/sched_staircase.c --- oldtree/kernel/sched_staircase.c 2006-09-29 14:45:59.000000000 -0400 +++ newtree/kernel/sched_staircase.c 2006-09-29 15:01:10.000000000 -0400 @@ -47,6 +47,7 @@ #include #include +#include /* * sched_interactive - sysctl which allows interactive tasks to have bonus @@ -56,9 +57,43 @@ * sched_iso_cpu - sysctl which determines the cpu percentage SCHED_ISO tasks * are allowed to run (over ISO_PERIOD seconds) as real time tasks. */ + +/* Staircase Kconfig */ +#ifdef CONFIG_STAIRCASE_SERVER +int sched_interactive __read_mostly = 0; +int sched_compute __read_mostly; +int sched_iso_cpu __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_FILE_SERVER +int sched_interactive __read_mostly = 0; +int sched_compute __read_mostly; +int sched_iso_cpu __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_COMPUTE_SERVER +int sched_interactive __read_mostly = 0; +int sched_compute __read_mostly = 1; +int sched_iso_cpu __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_GAMING +int sched_interactive __read_mostly = 0; +int sched_compute __read_mostly = 1; +int sched_iso_cpu __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_DESKTOP int sched_interactive __read_mostly = 1; int sched_compute __read_mostly; int sched_iso_cpu __read_mostly = 80; +#endif +#ifdef CONFIG_STAIRCASE_LL_DESKTOP +int sched_interactive __read_mostly = 1; +int sched_compute __read_mostly; +int sched_iso_cpu __read_mostly = 80; +#endif +#ifdef CONFIG_STAIRCASE_CUSTOM +int sched_interactive __read_mostly = CONFIG_SCHED_INTERACTIVE_SETTING; +int sched_compute __read_mostly = CONFIG_SCHED_COMPUTE_SETTING; +int sched_iso_cpu __read_mostly = CONFIG_SCHED_ISO_CPU_SETTING; +#endif #define ISO_PERIOD (5 * HZ) /* @@ -99,9 +134,40 @@ * This is the time all tasks within the same priority round robin. * Set to a minimum of 6ms. It is 10 times longer in compute mode. */ -#define _RR_INTERVAL ((6 * HZ / 1001) + 1) + +/* Staircase Tunables */ +#ifdef CONFIG_STAIRCASE_SERVER +int staircase_rr_slice = 6; +int staircase_rr_factor = 19; +#endif +#ifdef CONFIG_STAIRCASE_FILE_SERVER +int staircase_rr_slice = 6; +int staircase_rr_factor = 19; +#endif +#ifdef CONFIG_STAIRCASE_COMPUTE_SERVER +int staircase_rr_slice = 6; +int staircase_rr_factor = 19; +#endif +#ifdef CONFIG_STAIRCASE_GAMING +int staircase_rr_slice = 6; +int staircase_rr_factor = 19; +#endif +#ifdef CONFIG_STAIRCASE_DESKTOP +int staircase_rr_slice = 6; +int staircase_rr_factor = 19; +#endif +#ifdef CONFIG_STAIRCASE_LL_DESKTOP +int staircase_rr_slice = 3; +int staircase_rr_factor = 11; +#endif +#ifdef CONFIG_STAIRCASE_CUSTOM +int staircase_rr_slice = CONFIG_STAIRCASE_RR_SLICE; +int staircase_rr_factor = CONFIG_STAIRCASE_RR_FACTOR; +#endif + +#define _RR_INTERVAL ((staircase_rr_slice * HZ / 1001) + 1) #define RR_INTERVAL (_RR_INTERVAL * (1 + 9 * sched_compute)) -#define DEF_TIMESLICE (RR_INTERVAL * 19) +#define DEF_TIMESLICE (RR_INTERVAL * staircase_rr_factor) /* diff -urN oldtree/kernel/sysctl.c newtree/kernel/sysctl.c --- oldtree/kernel/sysctl.c 2006-09-29 14:59:47.000000000 -0400 +++ newtree/kernel/sysctl.c 2006-09-29 15:01:30.000000000 -0400 @@ -75,6 +75,15 @@ extern int percpu_pagelist_fraction; extern int compat_log; extern int vm_tail_largefiles; +#ifdef CONFIG_STAIRCASE +/* STAIRCASE Tunables */ +extern int staircase_rr_slice; +extern int staircase_rr_factor; +static int _s_minslice = 2; +static int _s_maxslice = 50; +static int _s_minfactor = 2; +static int _s_maxfactor = 50; +#endif #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) int unknown_nmi_panic; @@ -688,6 +697,30 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, +#ifdef CONFIG_STAIRCASE + { + .ctl_name = KERN_STRCS_RR_SLICE, + .procname = "staircase_rr_slice", + .data = &staircase_rr_slice, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec_minmax, + .strategy = &sysctl_intvec, + .extra1 = &_s_minslice, + .extra2 = &_s_maxslice, + }, + { + .ctl_name = KERN_STRCS_RR_FACTOR, + .procname = "staircase_rr_factor", + .data = &staircase_rr_factor, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec_minmax, + .strategy = &sysctl_intvec, + .extra1 = &_s_minfactor, + .extra2 = &_s_maxfactor, + }, +#endif { .ctl_name = KERN_BOOTLOADER_TYPE, .procname = "bootloader_type", diff -urN oldtree/mm/filemap.c newtree/mm/filemap.c --- oldtree/mm/filemap.c 2006-09-29 14:59:47.000000000 -0400 +++ newtree/mm/filemap.c 2006-09-29 15:01:35.000000000 -0400 @@ -32,6 +32,7 @@ #include #include "filemap.h" #include "internal.h" +#include /* * FIXME: remove all knowledge of the buffer layer from the core VM @@ -882,7 +883,28 @@ * Sysctl which determines whether we should read from large files to the * tail of the inactive lru list. */ +/* Staircase Tunables */ +#ifdef CONFIG_STAIRCASE_SERVER +int vm_tail_largefiles __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_FILE_SERVER +int vm_tail_largefiles __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_COMPUTE_SERVER +int vm_tail_largefiles __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_GAMING +int vm_tail_largefiles __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_DESKTOP int vm_tail_largefiles __read_mostly = 1; +#endif +#ifdef CONFIG_STAIRCASE_LL_DESKTOP +int vm_tail_largefiles __read_mostly = 1; +#endif +#ifdef CONFIG_STAIRCASE_CUSTOM +int vm_tail_largefiles __read_mostly = CONFIG_VM_TAIL_LARGEFILES_SETTING; +#endif static inline int nr_mapped(void) { diff -urN oldtree/mm/page-writeback.c newtree/mm/page-writeback.c --- oldtree/mm/page-writeback.c 2006-09-29 14:57:23.000000000 -0400 +++ newtree/mm/page-writeback.c 2006-09-29 15:01:50.000000000 -0400 @@ -30,6 +30,7 @@ #include #include #include +#include /* * The maximum number of pages to writeout in a single bdflush/kupdate @@ -69,7 +70,28 @@ /* * The generator of dirty data starts writeback at this percentage */ -int vm_dirty_ratio __read_mostly; +/* E-Mission Insanity */ +#ifdef CONFIG_STAIRCASE_SERVER +int vm_dirty_ratio __read_mostly = 66; +#endif +#ifdef CONFIG_STAIRCASE_FILE_SERVER +int vm_dirty_ratio __read_mostly = 66; +#endif +#ifdef CONFIG_STAIRCASE_COMPUTE_SERVER +int vm_dirty_ratio __read_mostly = 66; +#endif +#ifdef CONFIG_STAIRCASE_GAMING +int vm_dirty_ratio __read_mostly = 66; +#endif +#ifdef CONFIG_STAIRCASE_DESKTOP +int vm_dirty_ratio __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_LL_DESKTOP +int vm_dirty_ratio __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_CUSTOM +int vm_dirty_ratio __read_mostly = CONFIG_VM_DIRTY_RATIO_SETTING; +#endif /* * The interval between `kupdate'-style writebacks, in jiffies diff -urN oldtree/mm/vmscan.c newtree/mm/vmscan.c --- oldtree/mm/vmscan.c 2006-09-29 14:59:47.000000000 -0400 +++ newtree/mm/vmscan.c 2006-09-29 15:01:35.000000000 -0400 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -113,8 +114,36 @@ /* * From 0 .. 100. Lower means more swappy. */ +/* Staircase Tunables */ +#ifdef CONFIG_STAIRCASE_SERVER +int vm_mapped __read_mostly = 33; +int vm_hardmaplimit __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_FILE_SERVER +int vm_mapped __read_mostly = 0; +int vm_hardmaplimit __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_COMPUTE_SERVER +int vm_mapped __read_mostly = 0; +int vm_hardmaplimit __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_GAMING +int vm_mapped __read_mostly = 33; +int vm_hardmaplimit __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_DESKTOP int vm_mapped __read_mostly = 66; int vm_hardmaplimit __read_mostly = 1; +#endif +#ifdef CONFIG_STAIRCASE_LL_DESKTOP +int vm_mapped __read_mostly = 66; +int vm_hardmaplimit __read_mostly = 0; +#endif +#ifdef CONFIG_STAIRCASE_CUSTOM +int vm_mapped __read_mostly = CONFIG_VM_MAPPED_SETTING; +int vm_hardmaplimit __read_mostly = CONFIG_VM_HARDMAPLIMIT_SETTING; +#endif + long vm_total_pages __read_mostly; /* The total number of pages which the VM controls */ static LIST_HEAD(shrinker_list);