percpu: free percpu allocation info for uniprocessor system
authorHonggang Li <enjoymindful@gmail.com>
Tue, 12 Aug 2014 13:36:15 +0000 (21:36 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 5 Nov 2014 20:27:38 +0000 (20:27 +0000)
commit 3189eddbcafcc4d827f7f19facbeddec4424eba8 upstream.

Currently, only SMP system free the percpu allocation info.
Uniprocessor system should free it too. For example, one x86 UML
virtual machine with 256MB memory, UML kernel wastes one page memory.

Signed-off-by: Honggang Li <enjoymindful@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
mm/percpu.c

index 5c29750..e29a1c4 100644 (file)
@@ -1895,6 +1895,8 @@ void __init setup_per_cpu_areas(void)
 
        if (pcpu_setup_first_chunk(ai, fc) < 0)
                panic("Failed to initialize percpu areas.");
 
        if (pcpu_setup_first_chunk(ai, fc) < 0)
                panic("Failed to initialize percpu areas.");
+
+       pcpu_free_alloc_info(ai);
 }
 
 #endif /* CONFIG_SMP */
 }
 
 #endif /* CONFIG_SMP */