mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
memcg: fix page_cgroup fatal error in FLATMEM
Now, SLAB is configured in very early stage and it can be used in init routine now. But replacing alloc_bootmem() in FLAT/DISCONTIGMEM's page_cgroup() initialization breaks the allocation, now. (Works well in SPARSEMEM case...it supports MEMORY_HOTPLUG and size of page_cgroup is in reasonable size (< 1 << MAX_ORDER.) This patch revive FLATMEM+memory cgroup by using alloc_bootmem. In future, We stop to support FLATMEM (if no users) or rewrite codes for flatmem completely.But this will adds more messy codes and overheads. Reported-by: Li Zefan <lizf@cn.fujitsu.com> Tested-by: Li Zefan <lizf@cn.fujitsu.com> Tested-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This commit is contained in:
parent
8ebf975608
commit
ca371c0d7e
3 changed files with 32 additions and 20 deletions
|
@ -18,7 +18,19 @@ struct page_cgroup {
|
|||
};
|
||||
|
||||
void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat);
|
||||
void __init page_cgroup_init(void);
|
||||
|
||||
#ifdef CONFIG_SPARSEMEM
|
||||
static inline void __init page_cgroup_init_flatmem(void)
|
||||
{
|
||||
}
|
||||
extern void __init page_cgroup_init(void);
|
||||
#else
|
||||
void __init page_cgroup_init_flatmem(void);
|
||||
static inline void __init page_cgroup_init(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
struct page_cgroup *lookup_page_cgroup(struct page *page);
|
||||
|
||||
enum {
|
||||
|
@ -87,6 +99,10 @@ static inline void page_cgroup_init(void)
|
|||
{
|
||||
}
|
||||
|
||||
static inline void __init page_cgroup_init_flatmem(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue