diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-05-09 05:35:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 15:30:56 -0400 |
commit | 77461ab33229d48614402decfb1b2eaa6d446861 (patch) | |
tree | d2675ff079e887645ed25ae5f793aa907d53c66a | |
parent | d1187ed21026fd512b87851d0ca26d9ae16f9059 (diff) |
Make vm statistics update interval configurable
Make it configurable. Code in mm makes the vm statistics intervals
independent from the cache reaper use that opportunity to make it
configurable.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/sysctl.c | 12 | ||||
-rw-r--r-- | mm/vmstat.c | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index f0664bd5011c..4073353abd4f 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -77,6 +77,7 @@ extern int sysctl_drop_caches; | |||
77 | extern int percpu_pagelist_fraction; | 77 | extern int percpu_pagelist_fraction; |
78 | extern int compat_log; | 78 | extern int compat_log; |
79 | extern int maps_protect; | 79 | extern int maps_protect; |
80 | extern int sysctl_stat_interval; | ||
80 | 81 | ||
81 | /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ | 82 | /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ |
82 | static int maxolduid = 65535; | 83 | static int maxolduid = 65535; |
@@ -857,6 +858,17 @@ static ctl_table vm_table[] = { | |||
857 | .extra2 = &one_hundred, | 858 | .extra2 = &one_hundred, |
858 | }, | 859 | }, |
859 | #endif | 860 | #endif |
861 | #ifdef CONFIG_SMP | ||
862 | { | ||
863 | .ctl_name = CTL_UNNUMBERED, | ||
864 | .procname = "stat_interval", | ||
865 | .data = &sysctl_stat_interval, | ||
866 | .maxlen = sizeof(sysctl_stat_interval), | ||
867 | .mode = 0644, | ||
868 | .proc_handler = &proc_dointvec_jiffies, | ||
869 | .strategy = &sysctl_jiffies, | ||
870 | }, | ||
871 | #endif | ||
860 | #if defined(CONFIG_X86_32) || \ | 872 | #if defined(CONFIG_X86_32) || \ |
861 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) | 873 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) |
862 | { | 874 | { |
diff --git a/mm/vmstat.c b/mm/vmstat.c index 9d824643a22f..006eb7621869 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -641,11 +641,13 @@ const struct seq_operations vmstat_op = { | |||
641 | 641 | ||
642 | #ifdef CONFIG_SMP | 642 | #ifdef CONFIG_SMP |
643 | static DEFINE_PER_CPU(struct delayed_work, vmstat_work); | 643 | static DEFINE_PER_CPU(struct delayed_work, vmstat_work); |
644 | int sysctl_stat_interval __read_mostly = HZ; | ||
644 | 645 | ||
645 | static void vmstat_update(struct work_struct *w) | 646 | static void vmstat_update(struct work_struct *w) |
646 | { | 647 | { |
647 | refresh_cpu_vm_stats(smp_processor_id()); | 648 | refresh_cpu_vm_stats(smp_processor_id()); |
648 | schedule_delayed_work(&__get_cpu_var(vmstat_work), HZ); | 649 | schedule_delayed_work(&__get_cpu_var(vmstat_work), |
650 | sysctl_stat_interval); | ||
649 | } | 651 | } |
650 | 652 | ||
651 | static void __devinit start_cpu_timer(int cpu) | 653 | static void __devinit start_cpu_timer(int cpu) |