diff options
| author | Bob Liu <lliubbo@gmail.com> | 2012-01-12 20:19:08 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-12 23:13:08 -0500 |
| commit | 0efc8eb9c6a177836dac88b2cbb8815f9e4f8d5a (patch) | |
| tree | e0da1e44675f2c8be76f75b39efefc5f96c64a3f | |
| parent | d0048b0e59c1218d62bb4d014f34bbd7e7c0a214 (diff) | |
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>
| -rw-r--r-- | mm/page_cgroup.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index b99d19edf89b..de1616aa9b1e 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c | |||
| @@ -124,22 +124,6 @@ static void *__meminit alloc_page_cgroup(size_t size, int nid) | |||
| 124 | return addr; | 124 | return addr; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
| 128 | static void free_page_cgroup(void *addr) | ||
| 129 | { | ||
| 130 | if (is_vmalloc_addr(addr)) { | ||
| 131 | vfree(addr); | ||
| 132 | } else { | ||
| 133 | struct page *page = virt_to_page(addr); | ||
| 134 | size_t table_size = | ||
| 135 | sizeof(struct page_cgroup) * PAGES_PER_SECTION; | ||
| 136 | |||
| 137 | BUG_ON(PageReserved(page)); | ||
| 138 | free_pages_exact(addr, table_size); | ||
| 139 | } | ||
| 140 | } | ||
| 141 | #endif | ||
| 142 | |||
| 143 | static int __meminit init_section_page_cgroup(unsigned long pfn, int nid) | 127 | static int __meminit init_section_page_cgroup(unsigned long pfn, int nid) |
| 144 | { | 128 | { |
| 145 | struct mem_section *section; | 129 | struct mem_section *section; |
| @@ -176,6 +160,20 @@ static int __meminit init_section_page_cgroup(unsigned long pfn, int nid) | |||
| 176 | return 0; | 160 | return 0; |
| 177 | } | 161 | } |
| 178 | #ifdef CONFIG_MEMORY_HOTPLUG | 162 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 163 | static void free_page_cgroup(void *addr) | ||
| 164 | { | ||
| 165 | if (is_vmalloc_addr(addr)) { | ||
| 166 | vfree(addr); | ||
| 167 | } else { | ||
| 168 | struct page *page = virt_to_page(addr); | ||
| 169 | size_t table_size = | ||
| 170 | sizeof(struct page_cgroup) * PAGES_PER_SECTION; | ||
| 171 | |||
| 172 | BUG_ON(PageReserved(page)); | ||
| 173 | free_pages_exact(addr, table_size); | ||
| 174 | } | ||
| 175 | } | ||
| 176 | |||
| 179 | void __free_page_cgroup(unsigned long pfn) | 177 | void __free_page_cgroup(unsigned long pfn) |
| 180 | { | 178 | { |
| 181 | struct mem_section *ms; | 179 | struct mem_section *ms; |
