From f9054025fb65d0802098f18b153e4d720acd126e Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Thu, 31 Jul 2014 09:28:28 +1000 Subject: on demand vmstat: Do not open code alloc_cpumask_var Signed-off-by: Christoph Lameter Cc: Frederic Weisbecker Cc: Gilad Ben-Yossef Cc: Thomas Gleixner Cc: Tejun Heo Cc: John Stultz Cc: Mike Frysinger Cc: Minchan Kim Cc: Hakan Akkan Cc: Max Krasnyansky Cc: "Paul E. McKenney" Cc: Hugh Dickins Cc: Viresh Kumar Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: Andrew Morton --- mm/vmstat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mm') diff --git a/mm/vmstat.c b/mm/vmstat.c index a3a5cced5aac..c4d42e27ca9e 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1245,7 +1245,7 @@ static const struct file_operations proc_vmstat_file_operations = { #ifdef CONFIG_SMP static DEFINE_PER_CPU(struct delayed_work, vmstat_work); int sysctl_stat_interval __read_mostly = HZ; -static struct cpumask *cpu_stat_off; +static cpumask_var_t cpu_stat_off; static void vmstat_update(struct work_struct *w) { @@ -1339,7 +1339,8 @@ static void __init start_shepherd_timer(void) INIT_DEFERRABLE_WORK(per_cpu_ptr(&vmstat_work, cpu), vmstat_update); - cpu_stat_off = kmalloc(cpumask_size(), GFP_KERNEL); + if (!alloc_cpumask_var(&cpu_stat_off, GFP_KERNEL)) + BUG(); cpumask_copy(cpu_stat_off, cpu_online_mask); schedule_delayed_work(&shepherd, -- cgit v1.2.3