* [linux-next PATCH] Free percpu allocation info for uniprocessor system
@ 2014-08-12 13:36 Honggang Li
2014-08-12 13:36 ` [PATCH] " Honggang Li
0 siblings, 1 reply; 3+ messages in thread
From: Honggang Li @ 2014-08-12 13:36 UTC (permalink / raw)
To: tj, cl, linux-mm, user-mode-linux-devel; +Cc: linux-kernel, Honggang Li
Uniprocessor system should free percpu allocation info after use as SMP system.
Following table is the bootmem allocation information of one x86 UML virtual
machine with 256MB memory. The virtual machine is running linux-3.12.6.
Page (0x8c07000) is wasted.
|------------------------------------------------------------------------------
|0x8a02000 empty_zero_page size=4096, align=4096
|0x8a03000 empty_bad_page size=4096, align=4096
|0x8a04000 mem_map,contig_page_data->node_mem_map size=2097152, align=32
|0x8c04000 contig_page_data->pageblock_flags size=24, align=32
|0x8c04020 contig_page_data->wait_table size=2048, align=32
|0x8c05000 pte_t* size=4096, align=4096
|0x8c06000 saved_command_line size=91, align=32
|0x8c06060 static_command_line size=91, align=32
|0x8c060c0 pcpu_alloc_info *ai size=4096, align=32
|0x8c08000 pcpu_base_addr size=32768, align=4096
|0x8c10000 pcpu_group_offsets size=4, align=32
|0x8c10020 pcpu_group_sizes size=4, align=32
|0x8c10040 pcpu_unit_map size=4, align=32
|0x8c10060 pcpu_unit_offsets size=4, align=32
|0x8c10080 pcpu_slot size=120, align=32
|0x8c10100 pcpu_first_chunk size=44, align=32
|0x8c10140 pid_hash size=4096, align=32
|0x8c11140 dentry_hashtable size=131072, align=32
|0x8c31140 inode_hashtable size=65536, align=32
|------------------------------------------------------------------------------
Recent UML is broken because of the commit:
"resource: provide new functions to walk through resources"
As a result, the patch had been tested on x86 and x86_64 UML virtual
machines based on linux-next-v3.16.
Honggang Li (1):
Free percpu allocation info for uniprocessor system
mm/percpu.c | 2 ++
1 file changed, 2 insertions(+)
--
1.8.3.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Free percpu allocation info for uniprocessor system
2014-08-12 13:36 [linux-next PATCH] Free percpu allocation info for uniprocessor system Honggang Li
@ 2014-08-12 13:36 ` Honggang Li
2014-08-16 12:59 ` Tejun Heo
0 siblings, 1 reply; 3+ messages in thread
From: Honggang Li @ 2014-08-12 13:36 UTC (permalink / raw)
To: tj, cl, linux-mm, user-mode-linux-devel; +Cc: linux-kernel, Honggang Li
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>
---
mm/percpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/percpu.c b/mm/percpu.c
index 2139e30..da997f9 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1932,6 +1932,8 @@ void __init setup_per_cpu_areas(void)
if (pcpu_setup_first_chunk(ai, fc) < 0)
panic("Failed to initialize percpu areas.");
+
+ pcpu_free_alloc_info(ai);
}
#endif /* CONFIG_SMP */
--
1.8.3.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Free percpu allocation info for uniprocessor system
2014-08-12 13:36 ` [PATCH] " Honggang Li
@ 2014-08-16 12:59 ` Tejun Heo
0 siblings, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2014-08-16 12:59 UTC (permalink / raw)
To: Honggang Li; +Cc: cl, linux-mm, user-mode-linux-devel, linux-kernel
On Tue, Aug 12, 2014 at 09:36:15PM +0800, Honggang Li wrote:
> 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>
Applied to percpu/for-3.17-fixes w/ stable cc'd.
Thanks.
--
tejun
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-16 12:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-12 13:36 [linux-next PATCH] Free percpu allocation info for uniprocessor system Honggang Li
2014-08-12 13:36 ` [PATCH] " Honggang Li
2014-08-16 12:59 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).