Skip to content

Commit

Permalink
page_cgroup: drop multi CONFIG_MEMORY_HOTPLUG
Browse files Browse the repository at this point in the history
No need for two CONFIG_MEMORY_HOTPLUG blocks.

Signed-off-by: Bob Liu <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Johannes Weiner <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
aet00 authored and torvalds committed Jan 13, 2012
1 parent d0048b0 commit 0efc8eb
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions mm/page_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0efc8eb

Please sign in to comment.