mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
page_cgroup: drop multi CONFIG_MEMORY_HOTPLUG
No need for two CONFIG_MEMORY_HOTPLUG blocks. Signed-off-by: Bob Liu <lliubbo@gmail.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Johannes Weiner <hannes@cmpxchg.org> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d0048b0e59
commit
0efc8eb9c6
1 changed files with 14 additions and 16 deletions
|
@ -124,22 +124,6 @@ static void *__meminit alloc_page_cgroup(size_t size, int nid)
|
|||
return addr;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||
static void free_page_cgroup(void *addr)
|
||||
{
|
||||
if (is_vmalloc_addr(addr)) {
|
||||
vfree(addr);
|
||||
} else {
|
||||
struct page *page = virt_to_page(addr);
|
||||
size_t table_size =
|
||||
sizeof(struct page_cgroup) * PAGES_PER_SECTION;
|
||||
|
||||
BUG_ON(PageReserved(page));
|
||||
free_pages_exact(addr, table_size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int __meminit init_section_page_cgroup(unsigned long pfn, int nid)
|
||||
{
|
||||
struct mem_section *section;
|
||||
|
@ -176,6 +160,20 @@ static int __meminit init_section_page_cgroup(unsigned long pfn, int nid)
|
|||
return 0;
|
||||
}
|
||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||
static void free_page_cgroup(void *addr)
|
||||
{
|
||||
if (is_vmalloc_addr(addr)) {
|
||||
vfree(addr);
|
||||
} else {
|
||||
struct page *page = virt_to_page(addr);
|
||||
size_t table_size =
|
||||
sizeof(struct page_cgroup) * PAGES_PER_SECTION;
|
||||
|
||||
BUG_ON(PageReserved(page));
|
||||
free_pages_exact(addr, table_size);
|
||||
}
|
||||
}
|
||||
|
||||
void __free_page_cgroup(unsigned long pfn)
|
||||
{
|
||||
struct mem_section *ms;
|
||||
|
|
Loading…
Reference in a new issue