* [PATCH 3/3] page_cgroup: drop multi CONFIG_MEMORY_HOTPLUG
@ 2011-12-20 10:03 Bob Liu
2011-12-20 14:41 ` Michal Hocko
2011-12-21 0:18 ` KAMEZAWA Hiroyuki
0 siblings, 2 replies; 3+ messages in thread
From: Bob Liu @ 2011-12-20 10:03 UTC (permalink / raw)
To: linux-mm; +Cc: hannes, mhocko, kamezawa.hiroyu, akpm, Bob Liu
No need two CONFIG_MEMORY_HOTPLUG place.
Signed-off-by: Bob Liu <lliubbo@gmail.com>
---
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 b99d19e..de1616a 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)
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;
--
1.7.0.4
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
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 3/3] page_cgroup: drop multi CONFIG_MEMORY_HOTPLUG
2011-12-20 10:03 [PATCH 3/3] page_cgroup: drop multi CONFIG_MEMORY_HOTPLUG Bob Liu
@ 2011-12-20 14:41 ` Michal Hocko
2011-12-21 0:18 ` KAMEZAWA Hiroyuki
1 sibling, 0 replies; 3+ messages in thread
From: Michal Hocko @ 2011-12-20 14:41 UTC (permalink / raw)
To: Bob Liu; +Cc: linux-mm, hannes, kamezawa.hiroyu, akpm
On Tue 20-12-11 18:03:41, Bob Liu wrote:
> No need two CONFIG_MEMORY_HOTPLUG place.
I originally wanted to have alloc and dealloc at one location but this
makes sense as well.
>
> Signed-off-by: Bob Liu <lliubbo@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Thanks
> ---
> 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 b99d19e..de1616a 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)
> 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;
> --
> 1.7.0.4
>
>
> --
> 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/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 3/3] page_cgroup: drop multi CONFIG_MEMORY_HOTPLUG
2011-12-20 10:03 [PATCH 3/3] page_cgroup: drop multi CONFIG_MEMORY_HOTPLUG Bob Liu
2011-12-20 14:41 ` Michal Hocko
@ 2011-12-21 0:18 ` KAMEZAWA Hiroyuki
1 sibling, 0 replies; 3+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-12-21 0:18 UTC (permalink / raw)
To: Bob Liu; +Cc: linux-mm, hannes, mhocko, akpm
On Tue, 20 Dec 2011 18:03:41 +0800
Bob Liu <lliubbo@gmail.com> wrote:
> No need two CONFIG_MEMORY_HOTPLUG place.
>
> Signed-off-by: Bob Liu <lliubbo@gmail.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
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:[~2011-12-21 0:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-20 10:03 [PATCH 3/3] page_cgroup: drop multi CONFIG_MEMORY_HOTPLUG Bob Liu
2011-12-20 14:41 ` Michal Hocko
2011-12-21 0:18 ` KAMEZAWA Hiroyuki
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).