Skip to content

Commit 77461ab

Browse files
Christoph LameterLinus Torvalds
authored andcommitted
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>
1 parent d1187ed commit 77461ab

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

kernel/sysctl.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ extern int sysctl_drop_caches;
7777
extern int percpu_pagelist_fraction;
7878
extern int compat_log;
7979
extern int maps_protect;
80+
extern int sysctl_stat_interval;
8081

8182
/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
8283
static int maxolduid = 65535;
@@ -857,6 +858,17 @@ static ctl_table vm_table[] = {
857858
.extra2 = &one_hundred,
858859
},
859860
#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
860872
#if defined(CONFIG_X86_32) || \
861873
(defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
862874
{

mm/vmstat.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,13 @@ const struct seq_operations vmstat_op = {
641641

642642
#ifdef CONFIG_SMP
643643
static DEFINE_PER_CPU(struct delayed_work, vmstat_work);
644+
int sysctl_stat_interval __read_mostly = HZ;
644645

645646
static void vmstat_update(struct work_struct *w)
646647
{
647648
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);
649651
}
650652

651653
static void __devinit start_cpu_timer(int cpu)

0 commit comments

Comments
 (0)