* [PATCH 1/3] memcg: mark init_section_page_cgroup() properly
@ 2011-03-18 12:54 ` Namhyung Kim
0 siblings, 0 replies; 48+ messages in thread
From: Namhyung Kim @ 2011-03-18 12:54 UTC (permalink / raw)
To: Paul Menage, Li Zefan
Cc: containers, linux-mm, linux-kernel, KAMEZAWA Hiroyuki
The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error
in FLATMEM") removes call to alloc_bootmem() in the function
so that it can be marked as __meminit to reduce memory usage
when MEMORY_HOTPLUG=n.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
mm/page_cgroup.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 5bffada7cde1..2d1a0fa01d7b 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -105,8 +105,7 @@ struct page_cgroup *lookup_page_cgroup(struct page *page)
return section->page_cgroup + pfn;
}
-/* __alloc_bootmem...() is protected by !slab_available() */
-static int __init_refok init_section_page_cgroup(unsigned long pfn)
+static int __meminit init_section_page_cgroup(unsigned long pfn)
{
struct mem_section *section = __pfn_to_section(pfn);
struct page_cgroup *base, *pc;
--
1.7.4
^ permalink raw reply related [flat|nested] 48+ messages in thread* [PATCH 1/3] memcg: mark init_section_page_cgroup() properly @ 2011-03-18 12:54 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-18 12:54 UTC (permalink / raw) To: Paul Menage, Li Zefan Cc: containers, linux-mm, linux-kernel, KAMEZAWA Hiroyuki The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error in FLATMEM") removes call to alloc_bootmem() in the function so that it can be marked as __meminit to reduce memory usage when MEMORY_HOTPLUG=n. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> --- mm/page_cgroup.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 5bffada7cde1..2d1a0fa01d7b 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -105,8 +105,7 @@ struct page_cgroup *lookup_page_cgroup(struct page *page) return section->page_cgroup + pfn; } -/* __alloc_bootmem...() is protected by !slab_available() */ -static int __init_refok init_section_page_cgroup(unsigned long pfn) +static int __meminit init_section_page_cgroup(unsigned long pfn) { struct mem_section *section = __pfn_to_section(pfn); struct page_cgroup *base, *pc; -- 1.7.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] 48+ messages in thread
[parent not found: <1300452855-10194-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length [not found] ` <1300452855-10194-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2011-03-18 12:54 ` Namhyung Kim 2011-03-18 12:54 ` [PATCH 3/3] memcg: move page-freeing code outside of lock Namhyung Kim ` (2 subsequent siblings) 3 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-18 12:54 UTC (permalink / raw) To: Paul Menage, Li Zefan Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA It allocated one more page than necessary if @max_pages was a multiple of SC_PER_PAGE. Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> --- mm/page_cgroup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 2d1a0fa01d7b..29951abc852e 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -446,7 +446,7 @@ int swap_cgroup_swapon(int type, unsigned long max_pages) if (!do_swap_account) return 0; - length = ((max_pages/SC_PER_PAGE) + 1); + length = DIV_ROUND_UP(max_pages, SC_PER_PAGE); array_size = length * sizeof(void *); array = vmalloc(array_size); -- 1.7.4 ^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH 3/3] memcg: move page-freeing code outside of lock [not found] ` <1300452855-10194-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2011-03-18 12:54 ` [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length Namhyung Kim @ 2011-03-18 12:54 ` Namhyung Kim 2011-03-21 23:57 ` [PATCH 1/3] memcg: mark init_section_page_cgroup() properly KAMEZAWA Hiroyuki 2011-04-01 1:18 ` Namhyung Kim 3 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-18 12:54 UTC (permalink / raw) To: Paul Menage, Li Zefan Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> --- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 29951abc852e..17eb5eb95bab 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -463,8 +463,8 @@ int swap_cgroup_swapon(int type, unsigned long max_pages) /* memory shortage */ ctrl->map = NULL; ctrl->length = 0; - vfree(array); mutex_unlock(&swap_cgroup_mutex); + vfree(array); goto nomem; } mutex_unlock(&swap_cgroup_mutex); @@ -479,7 +479,8 @@ nomem: void swap_cgroup_swapoff(int type) { - int i; + struct page **map; + unsigned long i, length; struct swap_cgroup_ctrl *ctrl; if (!do_swap_account) @@ -487,17 +488,20 @@ void swap_cgroup_swapoff(int type) mutex_lock(&swap_cgroup_mutex); ctrl = &swap_cgroup_ctrl[type]; - if (ctrl->map) { - for (i = 0; i < ctrl->length; i++) { - struct page *page = ctrl->map[i]; + map = ctrl->map; + length = ctrl->length; + ctrl->map = NULL; + ctrl->length = 0; + mutex_unlock(&swap_cgroup_mutex); + + if (map) { + for (i = 0; i < length; i++) { + struct page *page = map[i]; if (page) __free_page(page); } - vfree(ctrl->map); - ctrl->map = NULL; - ctrl->length = 0; + vfree(map); } - mutex_unlock(&swap_cgroup_mutex); } #endif -- 1.7.4 ^ permalink raw reply related [flat|nested] 48+ messages in thread
* Re: [PATCH 1/3] memcg: mark init_section_page_cgroup() properly [not found] ` <1300452855-10194-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2011-03-18 12:54 ` [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length Namhyung Kim 2011-03-18 12:54 ` [PATCH 3/3] memcg: move page-freeing code outside of lock Namhyung Kim @ 2011-03-21 23:57 ` KAMEZAWA Hiroyuki 2011-04-01 1:18 ` Namhyung Kim 3 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-21 23:57 UTC (permalink / raw) To: Namhyung Kim Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Fri, 18 Mar 2011 21:54:13 +0900 Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error > in FLATMEM") removes call to alloc_bootmem() in the function > so that it can be marked as __meminit to reduce memory usage > when MEMORY_HOTPLUG=n. > > Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> > --- > mm/page_cgroup.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c > index 5bffada7cde1..2d1a0fa01d7b 100644 > --- a/mm/page_cgroup.c > +++ b/mm/page_cgroup.c > @@ -105,8 +105,7 @@ struct page_cgroup *lookup_page_cgroup(struct page *page) > return section->page_cgroup + pfn; > } > > -/* __alloc_bootmem...() is protected by !slab_available() */ > -static int __init_refok init_section_page_cgroup(unsigned long pfn) > +static int __meminit init_section_page_cgroup(unsigned long pfn) > { > struct mem_section *section = __pfn_to_section(pfn); > struct page_cgroup *base, *pc; > -- > 1.7.4 > > ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 1/3] memcg: mark init_section_page_cgroup() properly [not found] ` <1300452855-10194-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> ` (2 preceding siblings ...) 2011-03-21 23:57 ` [PATCH 1/3] memcg: mark init_section_page_cgroup() properly KAMEZAWA Hiroyuki @ 2011-04-01 1:18 ` Namhyung Kim 3 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-04-01 1:18 UTC (permalink / raw) To: Andrew Morton Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage 2011-03-18 (금), 21:54 +0900, Namhyung Kim: > The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error > in FLATMEM") removes call to alloc_bootmem() in the function > so that it can be marked as __meminit to reduce memory usage > when MEMORY_HOTPLUG=n. > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > --- > mm/page_cgroup.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c > index 5bffada7cde1..2d1a0fa01d7b 100644 > --- a/mm/page_cgroup.c > +++ b/mm/page_cgroup.c > @@ -105,8 +105,7 @@ struct page_cgroup *lookup_page_cgroup(struct page *page) > return section->page_cgroup + pfn; > } > > -/* __alloc_bootmem...() is protected by !slab_available() */ > -static int __init_refok init_section_page_cgroup(unsigned long pfn) > +static int __meminit init_section_page_cgroup(unsigned long pfn) > { > struct mem_section *section = __pfn_to_section(pfn); > struct page_cgroup *base, *pc; Andrew, could you please have a look these patches too and consider applying them in your tree? I can resend them (with given Acked-by lines) if you want. Thanks. -- Regards, Namhyung Kim _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length 2011-03-18 12:54 ` Namhyung Kim @ 2011-03-18 12:54 ` Namhyung Kim -1 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-18 12:54 UTC (permalink / raw) To: Paul Menage, Li Zefan Cc: containers, linux-mm, linux-kernel, KAMEZAWA Hiroyuki It allocated one more page than necessary if @max_pages was a multiple of SC_PER_PAGE. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> --- mm/page_cgroup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 2d1a0fa01d7b..29951abc852e 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -446,7 +446,7 @@ int swap_cgroup_swapon(int type, unsigned long max_pages) if (!do_swap_account) return 0; - length = ((max_pages/SC_PER_PAGE) + 1); + length = DIV_ROUND_UP(max_pages, SC_PER_PAGE); array_size = length * sizeof(void *); array = vmalloc(array_size); -- 1.7.4 ^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length @ 2011-03-18 12:54 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-18 12:54 UTC (permalink / raw) To: Paul Menage, Li Zefan Cc: containers, linux-mm, linux-kernel, KAMEZAWA Hiroyuki It allocated one more page than necessary if @max_pages was a multiple of SC_PER_PAGE. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> --- mm/page_cgroup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 2d1a0fa01d7b..29951abc852e 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -446,7 +446,7 @@ int swap_cgroup_swapon(int type, unsigned long max_pages) if (!do_swap_account) return 0; - length = ((max_pages/SC_PER_PAGE) + 1); + length = DIV_ROUND_UP(max_pages, SC_PER_PAGE); array_size = length * sizeof(void *); array = vmalloc(array_size); -- 1.7.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] 48+ messages in thread
* Re: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length 2011-03-18 12:54 ` Namhyung Kim @ 2011-03-21 23:58 ` KAMEZAWA Hiroyuki -1 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-21 23:58 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Fri, 18 Mar 2011 21:54:14 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > It allocated one more page than necessary if @max_pages was > a multiple of SC_PER_PAGE. > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length @ 2011-03-21 23:58 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-21 23:58 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Fri, 18 Mar 2011 21:54:14 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > It allocated one more page than necessary if @max_pages was > a multiple of SC_PER_PAGE. > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.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] 48+ messages in thread
[parent not found: <20110322085844.31041d40.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* Re: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length [not found] ` <20110322085844.31041d40.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2011-03-22 3:13 ` Balbir Singh 0 siblings, 0 replies; 48+ messages in thread From: Balbir Singh @ 2011-03-22 3:13 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, Namhyung Kim On Tue, Mar 22, 2011 at 5:28 AM, KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> wrote: > On Fri, 18 Mar 2011 21:54:14 +0900 > Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> It allocated one more page than necessary if @max_pages was >> a multiple of SC_PER_PAGE. >> >> Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> > > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Acked-by: Balbir Singh <balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length 2011-03-21 23:58 ` KAMEZAWA Hiroyuki @ 2011-03-22 3:13 ` Balbir Singh -1 siblings, 0 replies; 48+ messages in thread From: Balbir Singh @ 2011-03-22 3:13 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Namhyung Kim, Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, Mar 22, 2011 at 5:28 AM, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > On Fri, 18 Mar 2011 21:54:14 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > >> It allocated one more page than necessary if @max_pages was >> a multiple of SC_PER_PAGE. >> >> Signed-off-by: Namhyung Kim <namhyung@gmail.com> >> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length @ 2011-03-22 3:13 ` Balbir Singh 0 siblings, 0 replies; 48+ messages in thread From: Balbir Singh @ 2011-03-22 3:13 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Namhyung Kim, Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, Mar 22, 2011 at 5:28 AM, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > On Fri, 18 Mar 2011 21:54:14 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > >> It allocated one more page than necessary if @max_pages was >> a multiple of SC_PER_PAGE. >> >> Signed-off-by: Namhyung Kim <namhyung@gmail.com> >> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.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] 48+ messages in thread
[parent not found: <1300452855-10194-2-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length [not found] ` <1300452855-10194-2-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2011-03-21 23:58 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-21 23:58 UTC (permalink / raw) To: Namhyung Kim Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Fri, 18 Mar 2011 21:54:14 +0900 Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > It allocated one more page than necessary if @max_pages was > a multiple of SC_PER_PAGE. > > Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> ^ permalink raw reply [flat|nested] 48+ messages in thread
* [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-18 12:54 ` Namhyung Kim @ 2011-03-18 12:54 ` Namhyung Kim -1 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-18 12:54 UTC (permalink / raw) To: Paul Menage, Li Zefan Cc: containers, linux-mm, linux-kernel, KAMEZAWA Hiroyuki Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> --- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 29951abc852e..17eb5eb95bab 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -463,8 +463,8 @@ int swap_cgroup_swapon(int type, unsigned long max_pages) /* memory shortage */ ctrl->map = NULL; ctrl->length = 0; - vfree(array); mutex_unlock(&swap_cgroup_mutex); + vfree(array); goto nomem; } mutex_unlock(&swap_cgroup_mutex); @@ -479,7 +479,8 @@ nomem: void swap_cgroup_swapoff(int type) { - int i; + struct page **map; + unsigned long i, length; struct swap_cgroup_ctrl *ctrl; if (!do_swap_account) @@ -487,17 +488,20 @@ void swap_cgroup_swapoff(int type) mutex_lock(&swap_cgroup_mutex); ctrl = &swap_cgroup_ctrl[type]; - if (ctrl->map) { - for (i = 0; i < ctrl->length; i++) { - struct page *page = ctrl->map[i]; + map = ctrl->map; + length = ctrl->length; + ctrl->map = NULL; + ctrl->length = 0; + mutex_unlock(&swap_cgroup_mutex); + + if (map) { + for (i = 0; i < length; i++) { + struct page *page = map[i]; if (page) __free_page(page); } - vfree(ctrl->map); - ctrl->map = NULL; - ctrl->length = 0; + vfree(map); } - mutex_unlock(&swap_cgroup_mutex); } #endif -- 1.7.4 ^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH 3/3] memcg: move page-freeing code outside of lock @ 2011-03-18 12:54 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-18 12:54 UTC (permalink / raw) To: Paul Menage, Li Zefan Cc: containers, linux-mm, linux-kernel, KAMEZAWA Hiroyuki Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> --- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 29951abc852e..17eb5eb95bab 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -463,8 +463,8 @@ int swap_cgroup_swapon(int type, unsigned long max_pages) /* memory shortage */ ctrl->map = NULL; ctrl->length = 0; - vfree(array); mutex_unlock(&swap_cgroup_mutex); + vfree(array); goto nomem; } mutex_unlock(&swap_cgroup_mutex); @@ -479,7 +479,8 @@ nomem: void swap_cgroup_swapoff(int type) { - int i; + struct page **map; + unsigned long i, length; struct swap_cgroup_ctrl *ctrl; if (!do_swap_account) @@ -487,17 +488,20 @@ void swap_cgroup_swapoff(int type) mutex_lock(&swap_cgroup_mutex); ctrl = &swap_cgroup_ctrl[type]; - if (ctrl->map) { - for (i = 0; i < ctrl->length; i++) { - struct page *page = ctrl->map[i]; + map = ctrl->map; + length = ctrl->length; + ctrl->map = NULL; + ctrl->length = 0; + mutex_unlock(&swap_cgroup_mutex); + + if (map) { + for (i = 0; i < length; i++) { + struct page *page = map[i]; if (page) __free_page(page); } - vfree(ctrl->map); - ctrl->map = NULL; - ctrl->length = 0; + vfree(map); } - mutex_unlock(&swap_cgroup_mutex); } #endif -- 1.7.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] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-18 12:54 ` Namhyung Kim @ 2011-03-21 23:59 ` KAMEZAWA Hiroyuki -1 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-21 23:59 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> What is the benefit of this patch ? -Kame ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock @ 2011-03-21 23:59 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-21 23:59 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> What is the benefit of this patch ? -Kame -- 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] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-21 23:59 ` KAMEZAWA Hiroyuki @ 2011-03-22 3:04 ` Namhyung Kim -1 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-22 3:04 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > On Fri, 18 Mar 2011 21:54:15 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > What is the benefit of this patch ? > > -Kame > Oh, I just thought generally it'd better call such a (potentially) costly function outside of locks and it could reduce few of theoretical contentions between swapons and/or offs. If it doesn't help any realistic cases I don't mind discarding it. Thanks. -- Regards, Namhyung Kim ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock @ 2011-03-22 3:04 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-22 3:04 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel 2011-03-22 (i??), 08:59 +0900, KAMEZAWA Hiroyuki: > On Fri, 18 Mar 2011 21:54:15 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > What is the benefit of this patch ? > > -Kame > Oh, I just thought generally it'd better call such a (potentially) costly function outside of locks and it could reduce few of theoretical contentions between swapons and/or offs. If it doesn't help any realistic cases I don't mind discarding it. Thanks. -- Regards, Namhyung Kim -- 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] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-22 3:04 ` Namhyung Kim (?) @ 2011-03-22 3:09 ` Balbir Singh -1 siblings, 0 replies; 48+ messages in thread From: Balbir Singh @ 2011-03-22 3:09 UTC (permalink / raw) To: Namhyung Kim Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage On Tue, Mar 22, 2011 at 8:34 AM, Namhyung Kim <namhyung@gmail.com> wrote: > > 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > > On Fri, 18 Mar 2011 21:54:15 +0900 > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > What is the benefit of this patch ? > > > > -Kame > > > > Oh, I just thought generally it'd better call such a (potentially) > costly function outside of locks and it could reduce few of theoretical > contentions between swapons and/or offs. If it doesn't help any > realistic cases I don't mind discarding it. swapoff is a rare path, I would not worry about it too much at all. Balbir _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-22 3:04 ` Namhyung Kim @ 2011-03-22 3:09 ` Balbir Singh -1 siblings, 0 replies; 48+ messages in thread From: Balbir Singh @ 2011-03-22 3:09 UTC (permalink / raw) To: Namhyung Kim Cc: KAMEZAWA Hiroyuki, Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, Mar 22, 2011 at 8:34 AM, Namhyung Kim <namhyung@gmail.com> wrote: > > 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > > On Fri, 18 Mar 2011 21:54:15 +0900 > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > What is the benefit of this patch ? > > > > -Kame > > > > Oh, I just thought generally it'd better call such a (potentially) > costly function outside of locks and it could reduce few of theoretical > contentions between swapons and/or offs. If it doesn't help any > realistic cases I don't mind discarding it. swapoff is a rare path, I would not worry about it too much at all. Balbir ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock @ 2011-03-22 3:09 ` Balbir Singh 0 siblings, 0 replies; 48+ messages in thread From: Balbir Singh @ 2011-03-22 3:09 UTC (permalink / raw) To: Namhyung Kim Cc: KAMEZAWA Hiroyuki, Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, Mar 22, 2011 at 8:34 AM, Namhyung Kim <namhyung@gmail.com> wrote: > > 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > > On Fri, 18 Mar 2011 21:54:15 +0900 > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > What is the benefit of this patch ? > > > > -Kame > > > > Oh, I just thought generally it'd better call such a (potentially) > costly function outside of locks and it could reduce few of theoretical > contentions between swapons and/or offs. If it doesn't help any > realistic cases I don't mind discarding it. swapoff is a rare path, I would not worry about it too much at all. Balbir -- 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] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-22 3:04 ` Namhyung Kim @ 2011-03-22 4:56 ` KAMEZAWA Hiroyuki -1 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-22 4:56 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, 22 Mar 2011 12:04:39 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > > On Fri, 18 Mar 2011 21:54:15 +0900 > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > What is the benefit of this patch ? > > > > -Kame > > > > Oh, I just thought generally it'd better call such a (potentially) > costly function outside of locks and it could reduce few of theoretical > contentions between swapons and/or offs. If it doesn't help any > realistic cases I don't mind discarding it. > My point is, please write patch description which shows for what this patc is. All cleanup are okay to me if it reasonable. But without patch description as "this is just a cleanup, no functional change, and the reason is...." we cannot maintain patches. Thanks, -Kame ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock @ 2011-03-22 4:56 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-22 4:56 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, 22 Mar 2011 12:04:39 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > 2011-03-22 (i??), 08:59 +0900, KAMEZAWA Hiroyuki: > > On Fri, 18 Mar 2011 21:54:15 +0900 > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > What is the benefit of this patch ? > > > > -Kame > > > > Oh, I just thought generally it'd better call such a (potentially) > costly function outside of locks and it could reduce few of theoretical > contentions between swapons and/or offs. If it doesn't help any > realistic cases I don't mind discarding it. > My point is, please write patch description which shows for what this patc is. All cleanup are okay to me if it reasonable. But without patch description as "this is just a cleanup, no functional change, and the reason is...." we cannot maintain patches. Thanks, -Kame -- 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] 48+ messages in thread
[parent not found: <20110322135619.90593f5d.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock [not found] ` <20110322135619.90593f5d.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2011-03-22 10:06 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-22 10:06 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA 2011-03-22 (화), 13:56 +0900, KAMEZAWA Hiroyuki: > On Tue, 22 Mar 2011 12:04:39 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > > > 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > > > On Fri, 18 Mar 2011 21:54:15 +0900 > > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > > > What is the benefit of this patch ? > > > > > > -Kame > > > > > > > Oh, I just thought generally it'd better call such a (potentially) > > costly function outside of locks and it could reduce few of theoretical > > contentions between swapons and/or offs. If it doesn't help any > > realistic cases I don't mind discarding it. > > > > My point is, please write patch description which shows for what this patc is. > All cleanup are okay to me if it reasonable. But without patch description as > "this is just a cleanup, no functional change, and the reason is...." > we cannot maintain patches. > > Thanks, > -Kame > OK, I will do that in the future. Anyway, do you want me to resend the patch with new description? Thanks. -- Regards, Namhyung Kim _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-22 4:56 ` KAMEZAWA Hiroyuki @ 2011-03-22 10:06 ` Namhyung Kim -1 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-22 10:06 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel 2011-03-22 (화), 13:56 +0900, KAMEZAWA Hiroyuki: > On Tue, 22 Mar 2011 12:04:39 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > > > 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > > > On Fri, 18 Mar 2011 21:54:15 +0900 > > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > > > What is the benefit of this patch ? > > > > > > -Kame > > > > > > > Oh, I just thought generally it'd better call such a (potentially) > > costly function outside of locks and it could reduce few of theoretical > > contentions between swapons and/or offs. If it doesn't help any > > realistic cases I don't mind discarding it. > > > > My point is, please write patch description which shows for what this patc is. > All cleanup are okay to me if it reasonable. But without patch description as > "this is just a cleanup, no functional change, and the reason is...." > we cannot maintain patches. > > Thanks, > -Kame > OK, I will do that in the future. Anyway, do you want me to resend the patch with new description? Thanks. -- Regards, Namhyung Kim ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock @ 2011-03-22 10:06 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-22 10:06 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel 2011-03-22 (i??), 13:56 +0900, KAMEZAWA Hiroyuki: > On Tue, 22 Mar 2011 12:04:39 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > > > 2011-03-22 (i??), 08:59 +0900, KAMEZAWA Hiroyuki: > > > On Fri, 18 Mar 2011 21:54:15 +0900 > > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > > > What is the benefit of this patch ? > > > > > > -Kame > > > > > > > Oh, I just thought generally it'd better call such a (potentially) > > costly function outside of locks and it could reduce few of theoretical > > contentions between swapons and/or offs. If it doesn't help any > > realistic cases I don't mind discarding it. > > > > My point is, please write patch description which shows for what this patc is. > All cleanup are okay to me if it reasonable. But without patch description as > "this is just a cleanup, no functional change, and the reason is...." > we cannot maintain patches. > > Thanks, > -Kame > OK, I will do that in the future. Anyway, do you want me to resend the patch with new description? Thanks. -- Regards, Namhyung Kim -- 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] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-22 10:06 ` Namhyung Kim @ 2011-03-23 4:36 ` KAMEZAWA Hiroyuki -1 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-23 4:36 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, 22 Mar 2011 19:06:57 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > 2011-03-22 (화), 13:56 +0900, KAMEZAWA Hiroyuki: > > On Tue, 22 Mar 2011 12:04:39 +0900 > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > > > > On Fri, 18 Mar 2011 21:54:15 +0900 > > > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > > > > > What is the benefit of this patch ? > > > > > > > > -Kame > > > > > > > > > > Oh, I just thought generally it'd better call such a (potentially) > > > costly function outside of locks and it could reduce few of theoretical > > > contentions between swapons and/or offs. If it doesn't help any > > > realistic cases I don't mind discarding it. > > > > > > > My point is, please write patch description which shows for what this patc is. > > All cleanup are okay to me if it reasonable. But without patch description as > > "this is just a cleanup, no functional change, and the reason is...." > > we cannot maintain patches. > > > > Thanks, > > -Kame > > > > OK, I will do that in the future. Anyway, do you want me to resend the > patch with new description? > please. I'll never ack a patch without description. Thanks, -Kame ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock @ 2011-03-23 4:36 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-23 4:36 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, 22 Mar 2011 19:06:57 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > 2011-03-22 (i??), 13:56 +0900, KAMEZAWA Hiroyuki: > > On Tue, 22 Mar 2011 12:04:39 +0900 > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > 2011-03-22 (i??), 08:59 +0900, KAMEZAWA Hiroyuki: > > > > On Fri, 18 Mar 2011 21:54:15 +0900 > > > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > > > > > What is the benefit of this patch ? > > > > > > > > -Kame > > > > > > > > > > Oh, I just thought generally it'd better call such a (potentially) > > > costly function outside of locks and it could reduce few of theoretical > > > contentions between swapons and/or offs. If it doesn't help any > > > realistic cases I don't mind discarding it. > > > > > > > My point is, please write patch description which shows for what this patc is. > > All cleanup are okay to me if it reasonable. But without patch description as > > "this is just a cleanup, no functional change, and the reason is...." > > we cannot maintain patches. > > > > Thanks, > > -Kame > > > > OK, I will do that in the future. Anyway, do you want me to resend the > patch with new description? > please. I'll never ack a patch without description. Thanks, -Kame -- 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] 48+ messages in thread
* [PATCH] memcg: move page-freeing code out of lock 2011-03-23 4:36 ` KAMEZAWA Hiroyuki @ 2011-03-23 11:59 ` Namhyung Kim -1 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-23 11:59 UTC (permalink / raw) To: KAMEZAWA Hiroyuki, Balbir Singh, Daisuke Nishimura Cc: linux-mm, linux-kernel, Paul Menage, Li Zefan, containers Move page-freeing code out of swap_cgroup_mutex in the hope that it could reduce few of theoretical contentions between swapons and/or swapoffs. This is just a cleanup, no functional changes. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Paul Menage <menage@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: containers@lists.linux-foundation.org --- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 29951abc852e..17eb5eb95bab 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -463,8 +463,8 @@ int swap_cgroup_swapon(int type, unsigned long max_pages) /* memory shortage */ ctrl->map = NULL; ctrl->length = 0; - vfree(array); mutex_unlock(&swap_cgroup_mutex); + vfree(array); goto nomem; } mutex_unlock(&swap_cgroup_mutex); @@ -479,7 +479,8 @@ nomem: void swap_cgroup_swapoff(int type) { - int i; + struct page **map; + unsigned long i, length; struct swap_cgroup_ctrl *ctrl; if (!do_swap_account) @@ -487,17 +488,20 @@ void swap_cgroup_swapoff(int type) mutex_lock(&swap_cgroup_mutex); ctrl = &swap_cgroup_ctrl[type]; - if (ctrl->map) { - for (i = 0; i < ctrl->length; i++) { - struct page *page = ctrl->map[i]; + map = ctrl->map; + length = ctrl->length; + ctrl->map = NULL; + ctrl->length = 0; + mutex_unlock(&swap_cgroup_mutex); + + if (map) { + for (i = 0; i < length; i++) { + struct page *page = map[i]; if (page) __free_page(page); } - vfree(ctrl->map); - ctrl->map = NULL; - ctrl->length = 0; + vfree(map); } - mutex_unlock(&swap_cgroup_mutex); } #endif -- 1.7.4 ^ permalink raw reply related [flat|nested] 48+ messages in thread
* [PATCH] memcg: move page-freeing code out of lock @ 2011-03-23 11:59 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-23 11:59 UTC (permalink / raw) To: KAMEZAWA Hiroyuki, Balbir Singh, Daisuke Nishimura Cc: linux-mm, linux-kernel, Paul Menage, Li Zefan, containers Move page-freeing code out of swap_cgroup_mutex in the hope that it could reduce few of theoretical contentions between swapons and/or swapoffs. This is just a cleanup, no functional changes. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Paul Menage <menage@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: containers@lists.linux-foundation.org --- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 29951abc852e..17eb5eb95bab 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -463,8 +463,8 @@ int swap_cgroup_swapon(int type, unsigned long max_pages) /* memory shortage */ ctrl->map = NULL; ctrl->length = 0; - vfree(array); mutex_unlock(&swap_cgroup_mutex); + vfree(array); goto nomem; } mutex_unlock(&swap_cgroup_mutex); @@ -479,7 +479,8 @@ nomem: void swap_cgroup_swapoff(int type) { - int i; + struct page **map; + unsigned long i, length; struct swap_cgroup_ctrl *ctrl; if (!do_swap_account) @@ -487,17 +488,20 @@ void swap_cgroup_swapoff(int type) mutex_lock(&swap_cgroup_mutex); ctrl = &swap_cgroup_ctrl[type]; - if (ctrl->map) { - for (i = 0; i < ctrl->length; i++) { - struct page *page = ctrl->map[i]; + map = ctrl->map; + length = ctrl->length; + ctrl->map = NULL; + ctrl->length = 0; + mutex_unlock(&swap_cgroup_mutex); + + if (map) { + for (i = 0; i < length; i++) { + struct page *page = map[i]; if (page) __free_page(page); } - vfree(ctrl->map); - ctrl->map = NULL; - ctrl->length = 0; + vfree(map); } - mutex_unlock(&swap_cgroup_mutex); } #endif -- 1.7.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] 48+ messages in thread
* Re: [PATCH] memcg: move page-freeing code out of lock 2011-03-23 11:59 ` Namhyung Kim @ 2011-03-23 23:37 ` KAMEZAWA Hiroyuki -1 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-23 23:37 UTC (permalink / raw) To: Namhyung Kim Cc: Balbir Singh, Daisuke Nishimura, linux-mm, linux-kernel, Paul Menage, Li Zefan, containers On Wed, 23 Mar 2011 20:59:18 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > Move page-freeing code out of swap_cgroup_mutex in the hope that it > could reduce few of theoretical contentions between swapons and/or > swapoffs. > > This is just a cleanup, no functional changes. > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: Paul Menage <menage@google.com> > Cc: Li Zefan <lizf@cn.fujitsu.com> > Cc: containers@lists.linux-foundation.org Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH] memcg: move page-freeing code out of lock @ 2011-03-23 23:37 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-23 23:37 UTC (permalink / raw) To: Namhyung Kim Cc: Balbir Singh, Daisuke Nishimura, linux-mm, linux-kernel, Paul Menage, Li Zefan, containers On Wed, 23 Mar 2011 20:59:18 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > Move page-freeing code out of swap_cgroup_mutex in the hope that it > could reduce few of theoretical contentions between swapons and/or > swapoffs. > > This is just a cleanup, no functional changes. > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: Paul Menage <menage@google.com> > Cc: Li Zefan <lizf@cn.fujitsu.com> > Cc: containers@lists.linux-foundation.org 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] 48+ messages in thread
[parent not found: <1300881558-13523-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] memcg: move page-freeing code out of lock [not found] ` <1300881558-13523-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2011-03-23 23:37 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-23 23:37 UTC (permalink / raw) To: Namhyung Kim Cc: Daisuke Nishimura, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, Balbir Singh On Wed, 23 Mar 2011 20:59:18 +0900 Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Move page-freeing code out of swap_cgroup_mutex in the hope that it > could reduce few of theoretical contentions between swapons and/or > swapoffs. > > This is just a cleanup, no functional changes. > > Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Cc: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> > Cc: Li Zefan <lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> > Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> ^ permalink raw reply [flat|nested] 48+ messages in thread
[parent not found: <20110323133614.95553de8.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* [PATCH] memcg: move page-freeing code out of lock [not found] ` <20110323133614.95553de8.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2011-03-23 11:59 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-23 11:59 UTC (permalink / raw) To: KAMEZAWA Hiroyuki, Balbir Singh, Daisuke Nishimura Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Move page-freeing code out of swap_cgroup_mutex in the hope that it could reduce few of theoretical contentions between swapons and/or swapoffs. This is just a cleanup, no functional changes. Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Cc: Li Zefan <lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org --- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 29951abc852e..17eb5eb95bab 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -463,8 +463,8 @@ int swap_cgroup_swapon(int type, unsigned long max_pages) /* memory shortage */ ctrl->map = NULL; ctrl->length = 0; - vfree(array); mutex_unlock(&swap_cgroup_mutex); + vfree(array); goto nomem; } mutex_unlock(&swap_cgroup_mutex); @@ -479,7 +479,8 @@ nomem: void swap_cgroup_swapoff(int type) { - int i; + struct page **map; + unsigned long i, length; struct swap_cgroup_ctrl *ctrl; if (!do_swap_account) @@ -487,17 +488,20 @@ void swap_cgroup_swapoff(int type) mutex_lock(&swap_cgroup_mutex); ctrl = &swap_cgroup_ctrl[type]; - if (ctrl->map) { - for (i = 0; i < ctrl->length; i++) { - struct page *page = ctrl->map[i]; + map = ctrl->map; + length = ctrl->length; + ctrl->map = NULL; + ctrl->length = 0; + mutex_unlock(&swap_cgroup_mutex); + + if (map) { + for (i = 0; i < length; i++) { + struct page *page = map[i]; if (page) __free_page(page); } - vfree(ctrl->map); - ctrl->map = NULL; - ctrl->length = 0; + vfree(map); } - mutex_unlock(&swap_cgroup_mutex); } #endif -- 1.7.4 ^ permalink raw reply related [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-22 10:06 ` Namhyung Kim (?) (?) @ 2011-03-23 4:36 ` KAMEZAWA Hiroyuki -1 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-23 4:36 UTC (permalink / raw) To: Namhyung Kim Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Tue, 22 Mar 2011 19:06:57 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > 2011-03-22 (화), 13:56 +0900, KAMEZAWA Hiroyuki: > > On Tue, 22 Mar 2011 12:04:39 +0900 > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > > > > On Fri, 18 Mar 2011 21:54:15 +0900 > > > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > > > > > What is the benefit of this patch ? > > > > > > > > -Kame > > > > > > > > > > Oh, I just thought generally it'd better call such a (potentially) > > > costly function outside of locks and it could reduce few of theoretical > > > contentions between swapons and/or offs. If it doesn't help any > > > realistic cases I don't mind discarding it. > > > > > > > My point is, please write patch description which shows for what this patc is. > > All cleanup are okay to me if it reasonable. But without patch description as > > "this is just a cleanup, no functional change, and the reason is...." > > we cannot maintain patches. > > > > Thanks, > > -Kame > > > > OK, I will do that in the future. Anyway, do you want me to resend the > patch with new description? > please. I'll never ack a patch without description. Thanks, -Kame _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock 2011-03-22 3:04 ` Namhyung Kim ` (3 preceding siblings ...) (?) @ 2011-03-22 4:56 ` KAMEZAWA Hiroyuki -1 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-22 4:56 UTC (permalink / raw) To: Namhyung Kim Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Tue, 22 Mar 2011 12:04:39 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > > On Fri, 18 Mar 2011 21:54:15 +0900 > > Namhyung Kim <namhyung@gmail.com> wrote: > > > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > > What is the benefit of this patch ? > > > > -Kame > > > > Oh, I just thought generally it'd better call such a (potentially) > costly function outside of locks and it could reduce few of theoretical > contentions between swapons and/or offs. If it doesn't help any > realistic cases I don't mind discarding it. > My point is, please write patch description which shows for what this patc is. All cleanup are okay to me if it reasonable. But without patch description as "this is just a cleanup, no functional change, and the reason is...." we cannot maintain patches. Thanks, -Kame _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 48+ messages in thread
[parent not found: <20110322085938.0691f7f4.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock [not found] ` <20110322085938.0691f7f4.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2011-03-22 3:04 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-03-22 3:04 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA 2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki: > On Fri, 18 Mar 2011 21:54:15 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > What is the benefit of this patch ? > > -Kame > Oh, I just thought generally it'd better call such a (potentially) costly function outside of locks and it could reduce few of theoretical contentions between swapons and/or offs. If it doesn't help any realistic cases I don't mind discarding it. Thanks. -- Regards, Namhyung Kim _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 48+ messages in thread
[parent not found: <1300452855-10194-3-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH 3/3] memcg: move page-freeing code outside of lock [not found] ` <1300452855-10194-3-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2011-03-21 23:59 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-21 23:59 UTC (permalink / raw) To: Namhyung Kim Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> What is the benefit of this patch ? -Kame ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 1/3] memcg: mark init_section_page_cgroup() properly 2011-03-18 12:54 ` Namhyung Kim @ 2011-03-21 23:57 ` KAMEZAWA Hiroyuki -1 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-21 23:57 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Fri, 18 Mar 2011 21:54:13 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error > in FLATMEM") removes call to alloc_bootmem() in the function > so that it can be marked as __meminit to reduce memory usage > when MEMORY_HOTPLUG=n. > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > --- > mm/page_cgroup.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c > index 5bffada7cde1..2d1a0fa01d7b 100644 > --- a/mm/page_cgroup.c > +++ b/mm/page_cgroup.c > @@ -105,8 +105,7 @@ struct page_cgroup *lookup_page_cgroup(struct page *page) > return section->page_cgroup + pfn; > } > > -/* __alloc_bootmem...() is protected by !slab_available() */ > -static int __init_refok init_section_page_cgroup(unsigned long pfn) > +static int __meminit init_section_page_cgroup(unsigned long pfn) > { > struct mem_section *section = __pfn_to_section(pfn); > struct page_cgroup *base, *pc; > -- > 1.7.4 > > ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 1/3] memcg: mark init_section_page_cgroup() properly @ 2011-03-21 23:57 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 48+ messages in thread From: KAMEZAWA Hiroyuki @ 2011-03-21 23:57 UTC (permalink / raw) To: Namhyung Kim; +Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Fri, 18 Mar 2011 21:54:13 +0900 Namhyung Kim <namhyung@gmail.com> wrote: > The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error > in FLATMEM") removes call to alloc_bootmem() in the function > so that it can be marked as __meminit to reduce memory usage > when MEMORY_HOTPLUG=n. > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > --- > mm/page_cgroup.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c > index 5bffada7cde1..2d1a0fa01d7b 100644 > --- a/mm/page_cgroup.c > +++ b/mm/page_cgroup.c > @@ -105,8 +105,7 @@ struct page_cgroup *lookup_page_cgroup(struct page *page) > return section->page_cgroup + pfn; > } > > -/* __alloc_bootmem...() is protected by !slab_available() */ > -static int __init_refok init_section_page_cgroup(unsigned long pfn) > +static int __meminit init_section_page_cgroup(unsigned long pfn) > { > struct mem_section *section = __pfn_to_section(pfn); > struct page_cgroup *base, *pc; > -- > 1.7.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 [flat|nested] 48+ messages in thread
* Re: [PATCH 1/3] memcg: mark init_section_page_cgroup() properly 2011-03-21 23:57 ` KAMEZAWA Hiroyuki @ 2011-03-22 3:10 ` Balbir Singh -1 siblings, 0 replies; 48+ messages in thread From: Balbir Singh @ 2011-03-22 3:10 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Namhyung Kim, Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, Mar 22, 2011 at 5:27 AM, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > On Fri, 18 Mar 2011 21:54:13 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > >> The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error >> in FLATMEM") removes call to alloc_bootmem() in the function >> so that it can be marked as __meminit to reduce memory usage >> when MEMORY_HOTPLUG=n. >> >> Signed-off-by: Namhyung Kim <namhyung@gmail.com> >> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 1/3] memcg: mark init_section_page_cgroup() properly @ 2011-03-22 3:10 ` Balbir Singh 0 siblings, 0 replies; 48+ messages in thread From: Balbir Singh @ 2011-03-22 3:10 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Namhyung Kim, Paul Menage, Li Zefan, containers, linux-mm, linux-kernel On Tue, Mar 22, 2011 at 5:27 AM, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > On Fri, 18 Mar 2011 21:54:13 +0900 > Namhyung Kim <namhyung@gmail.com> wrote: > >> The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error >> in FLATMEM") removes call to alloc_bootmem() in the function >> so that it can be marked as __meminit to reduce memory usage >> when MEMORY_HOTPLUG=n. >> >> Signed-off-by: Namhyung Kim <namhyung@gmail.com> >> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.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] 48+ messages in thread
[parent not found: <20110322085755.c4193fc1.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* Re: [PATCH 1/3] memcg: mark init_section_page_cgroup() properly [not found] ` <20110322085755.c4193fc1.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2011-03-22 3:10 ` Balbir Singh 0 siblings, 0 replies; 48+ messages in thread From: Balbir Singh @ 2011-03-22 3:10 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage, Namhyung Kim On Tue, Mar 22, 2011 at 5:27 AM, KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> wrote: > On Fri, 18 Mar 2011 21:54:13 +0900 > Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error >> in FLATMEM") removes call to alloc_bootmem() in the function >> so that it can be marked as __meminit to reduce memory usage >> when MEMORY_HOTPLUG=n. >> >> Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Acked-by: Balbir Singh <balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 1/3] memcg: mark init_section_page_cgroup() properly 2011-03-18 12:54 ` Namhyung Kim @ 2011-04-01 1:18 ` Namhyung Kim -1 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-04-01 1:18 UTC (permalink / raw) To: Andrew Morton Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel, KAMEZAWA Hiroyuki 2011-03-18 (금), 21:54 +0900, Namhyung Kim: > The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error > in FLATMEM") removes call to alloc_bootmem() in the function > so that it can be marked as __meminit to reduce memory usage > when MEMORY_HOTPLUG=n. > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > --- > mm/page_cgroup.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c > index 5bffada7cde1..2d1a0fa01d7b 100644 > --- a/mm/page_cgroup.c > +++ b/mm/page_cgroup.c > @@ -105,8 +105,7 @@ struct page_cgroup *lookup_page_cgroup(struct page *page) > return section->page_cgroup + pfn; > } > > -/* __alloc_bootmem...() is protected by !slab_available() */ > -static int __init_refok init_section_page_cgroup(unsigned long pfn) > +static int __meminit init_section_page_cgroup(unsigned long pfn) > { > struct mem_section *section = __pfn_to_section(pfn); > struct page_cgroup *base, *pc; Andrew, could you please have a look these patches too and consider applying them in your tree? I can resend them (with given Acked-by lines) if you want. Thanks. -- Regards, Namhyung Kim ^ permalink raw reply [flat|nested] 48+ messages in thread
* Re: [PATCH 1/3] memcg: mark init_section_page_cgroup() properly @ 2011-04-01 1:18 ` Namhyung Kim 0 siblings, 0 replies; 48+ messages in thread From: Namhyung Kim @ 2011-04-01 1:18 UTC (permalink / raw) To: Andrew Morton Cc: Paul Menage, Li Zefan, containers, linux-mm, linux-kernel, KAMEZAWA Hiroyuki 2011-03-18 (e,?), 21:54 +0900, Namhyung Kim: > The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error > in FLATMEM") removes call to alloc_bootmem() in the function > so that it can be marked as __meminit to reduce memory usage > when MEMORY_HOTPLUG=n. > > Signed-off-by: Namhyung Kim <namhyung@gmail.com> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > --- > mm/page_cgroup.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c > index 5bffada7cde1..2d1a0fa01d7b 100644 > --- a/mm/page_cgroup.c > +++ b/mm/page_cgroup.c > @@ -105,8 +105,7 @@ struct page_cgroup *lookup_page_cgroup(struct page *page) > return section->page_cgroup + pfn; > } > > -/* __alloc_bootmem...() is protected by !slab_available() */ > -static int __init_refok init_section_page_cgroup(unsigned long pfn) > +static int __meminit init_section_page_cgroup(unsigned long pfn) > { > struct mem_section *section = __pfn_to_section(pfn); > struct page_cgroup *base, *pc; Andrew, could you please have a look these patches too and consider applying them in your tree? I can resend them (with given Acked-by lines) if you want. Thanks. -- Regards, Namhyung Kim -- 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] 48+ messages in thread
* [PATCH 1/3] memcg: mark init_section_page_cgroup() properly
@ 2011-03-18 12:54 Namhyung Kim
0 siblings, 0 replies; 48+ messages in thread
From: Namhyung Kim @ 2011-03-18 12:54 UTC (permalink / raw)
To: Paul Menage, Li Zefan
Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
The commit ca371c0d7e23 ("memcg: fix page_cgroup fatal error
in FLATMEM") removes call to alloc_bootmem() in the function
so that it can be marked as __meminit to reduce memory usage
when MEMORY_HOTPLUG=n.
Signed-off-by: Namhyung Kim <namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
---
mm/page_cgroup.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 5bffada7cde1..2d1a0fa01d7b 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -105,8 +105,7 @@ struct page_cgroup *lookup_page_cgroup(struct page *page)
return section->page_cgroup + pfn;
}
-/* __alloc_bootmem...() is protected by !slab_available() */
-static int __init_refok init_section_page_cgroup(unsigned long pfn)
+static int __meminit init_section_page_cgroup(unsigned long pfn)
{
struct mem_section *section = __pfn_to_section(pfn);
struct page_cgroup *base, *pc;
--
1.7.4
^ permalink raw reply related [flat|nested] 48+ messages in threadend of thread, other threads:[~2011-04-01 1:19 UTC | newest]
Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18 12:54 [PATCH 1/3] memcg: mark init_section_page_cgroup() properly Namhyung Kim
2011-03-18 12:54 ` Namhyung Kim
[not found] ` <1300452855-10194-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-03-18 12:54 ` [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length Namhyung Kim
2011-03-18 12:54 ` [PATCH 3/3] memcg: move page-freeing code outside of lock Namhyung Kim
2011-03-21 23:57 ` [PATCH 1/3] memcg: mark init_section_page_cgroup() properly KAMEZAWA Hiroyuki
2011-04-01 1:18 ` Namhyung Kim
2011-03-18 12:54 ` [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length Namhyung Kim
2011-03-18 12:54 ` Namhyung Kim
2011-03-21 23:58 ` KAMEZAWA Hiroyuki
2011-03-21 23:58 ` KAMEZAWA Hiroyuki
[not found] ` <20110322085844.31041d40.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-03-22 3:13 ` Balbir Singh
2011-03-22 3:13 ` Balbir Singh
2011-03-22 3:13 ` Balbir Singh
[not found] ` <1300452855-10194-2-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-03-21 23:58 ` KAMEZAWA Hiroyuki
2011-03-18 12:54 ` [PATCH 3/3] memcg: move page-freeing code outside of lock Namhyung Kim
2011-03-18 12:54 ` Namhyung Kim
2011-03-21 23:59 ` KAMEZAWA Hiroyuki
2011-03-21 23:59 ` KAMEZAWA Hiroyuki
2011-03-22 3:04 ` Namhyung Kim
2011-03-22 3:04 ` Namhyung Kim
2011-03-22 3:09 ` Balbir Singh
2011-03-22 3:09 ` Balbir Singh
2011-03-22 3:09 ` Balbir Singh
2011-03-22 4:56 ` KAMEZAWA Hiroyuki
2011-03-22 4:56 ` KAMEZAWA Hiroyuki
[not found] ` <20110322135619.90593f5d.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-03-22 10:06 ` Namhyung Kim
2011-03-22 10:06 ` Namhyung Kim
2011-03-22 10:06 ` Namhyung Kim
2011-03-23 4:36 ` KAMEZAWA Hiroyuki
2011-03-23 4:36 ` KAMEZAWA Hiroyuki
2011-03-23 11:59 ` [PATCH] memcg: move page-freeing code out " Namhyung Kim
2011-03-23 11:59 ` Namhyung Kim
2011-03-23 23:37 ` KAMEZAWA Hiroyuki
2011-03-23 23:37 ` KAMEZAWA Hiroyuki
[not found] ` <1300881558-13523-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-03-23 23:37 ` KAMEZAWA Hiroyuki
[not found] ` <20110323133614.95553de8.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-03-23 11:59 ` Namhyung Kim
2011-03-23 4:36 ` [PATCH 3/3] memcg: move page-freeing code outside " KAMEZAWA Hiroyuki
2011-03-22 4:56 ` KAMEZAWA Hiroyuki
[not found] ` <20110322085938.0691f7f4.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-03-22 3:04 ` Namhyung Kim
[not found] ` <1300452855-10194-3-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-03-21 23:59 ` KAMEZAWA Hiroyuki
2011-03-21 23:57 ` [PATCH 1/3] memcg: mark init_section_page_cgroup() properly KAMEZAWA Hiroyuki
2011-03-21 23:57 ` KAMEZAWA Hiroyuki
2011-03-22 3:10 ` Balbir Singh
2011-03-22 3:10 ` Balbir Singh
[not found] ` <20110322085755.c4193fc1.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-03-22 3:10 ` Balbir Singh
2011-04-01 1:18 ` Namhyung Kim
2011-04-01 1:18 ` Namhyung Kim
-- strict thread matches above, loose matches on Subject: below --
2011-03-18 12:54 Namhyung Kim
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.