memcg: mark init_section_page_cgroup() properly
PATCH 1/3 memcg: mark init_section_page_cgroup() properly
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.
--- mm/page_cgroup.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
mm/page_cgroup.c +1 -2
@@ -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;
Signature · 8 lines
1.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 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
It allocated one more page than necessary if @max_pages was a multiple of SC_PER_PAGE.
--- mm/page_cgroup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
mm/page_cgroup.c +1 -1
@@ -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);
Signature · 1 line
1.7.4
PATCH 3/3 memcg: move page-freeing code outside of lock
In reply to a message not in the archive--- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-)
mm/page_cgroup.c +13 -9
@@ -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
Signature · 1 line
1.7.4
KAMEZAWA Hiroyuki
Acked-byQuoted 7 lines · On Fri, 18 Mar 2011 21:54:13 +0900 Namhyung Kim…
The commit
ca371c0d7e23("memcg: fixpage_cgroupfatal error in FLATMEM") removes call toalloc_bootmem()in the function so that it can be marked as__meminitto reduce memory usage when MEMORY_HOTPLUG=n.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
Quoted 22 lines
--- mm/page_cgroup.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)mm/page_cgroup.c +1
-2@@ -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;Signature · 1 line
1.7.4
2011-03-18 (금), 21:54 +0900, Namhyung Kim:
Quoted 16 lines
The commit
ca371c0d7e23("memcg: fixpage_cgroupfatal error in FLATMEM") removes call toalloc_bootmem()in the function so that it can be marked as__meminitto reduce memory usage when MEMORY_HOTPLUG=n.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>--- mm/page_cgroup.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)mm/page_cgroup.c +0
-0
mm/page_cgroup.c struct page_cgroup *lookup_page_cgroup(struct page *page) · line 111
Quoted 9 lines
mm/page_cgroup.c +1
-2@@ -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.
Signature · 8 lines
Regards, Namhyung Kim _______________________________________________ Containers mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/containers
PATCH 2/3 memcg: fix off-by-one when calculating swap cgroup map length
In reply to Namhyung KimIt allocated one more page than necessary if @max_pages was a multiple of SC_PER_PAGE.
--- mm/page_cgroup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
mm/page_cgroup.c +1 -1
@@ -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);
Signature · 8 lines
1.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 1300452855-10194-2-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
KAMEZAWA Hiroyuki
Acked-byRe: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length
Quoted 5 lines · On Fri, 18 Mar 2011 21:54:14 +0900 Namhyung Kim…
It allocated one more page than necessary if @max_pages was a multiple of
SC_PER_PAGE.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
Re: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length
In reply to Namhyung KimQuoted 5 lines · On Fri, 18 Mar 2011 21:54:14 +0900 Namhyung Kim <[email protected]> wrote:
It allocated one more page than necessary if @max_pages was a multiple of
SC_PER_PAGE.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 20110322085844.31041d40.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org
Balbir Singh
Acked-byRe: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length
Quoted 10 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Fri, 18 Mar 2011 21:54:14 +0900 Namhyung Kim…
It allocated one more page than necessary if @max_pages was a multiple of
SC_PER_PAGE.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
Balbir Singh
Acked-byRe: [PATCH 2/3] memcg: fix off-by-one when calculating swap cgroup map length
In reply to KAMEZAWA HiroyukiQuoted 10 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Fri, 18 Mar 2011 21:54:14 +0900 Namhyung Kim <[email protected]> wrote:
It allocated one more page than necessary if @max_pages was a multiple of
SC_PER_PAGE.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
PATCH 3/3 memcg: move page-freeing code outside of lock
In reply to Namhyung Kim--- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-)
mm/page_cgroup.c +13 -9
@@ -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
Signature · 8 lines
1.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 1300452855-10194-3-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim…
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
What is the benefit of this patch ?
-Kame
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
In reply to Namhyung KimQuoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
What is the benefit of this patch ?
-Kame
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 20110322085938.0691f7f4.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 10 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>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.
Signature · 8 lines
Regards, Namhyung Kim _______________________________________________ Containers mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
In reply to KAMEZAWA Hiroyuki2011-03-22 (i??), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 10 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>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.
Signature · 10 lines
Regards, Namhyung Kim -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
Quoted 10 lines · Namhyung Kim
2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 8 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>What is the benefit of this patch ?
Quoted 7 lines
Quoted 2 lines
-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
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
In reply to Namhyung KimQuoted 10 lines · Namhyung Kim
2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 8 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>What is the benefit of this patch ?
Quoted 7 lines
Quoted 2 lines
-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 [email protected]. 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:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
In reply to Namhyung KimQuoted 9 lines · On Tue, 22 Mar 2011 12:04:39 +0900 Namhyung Kim <[email protected]> wrote:
2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 8 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>What is the benefit of this patch ?
Quoted 8 lines
Quoted 2 lines
-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
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
In reply to Namhyung KimQuoted 9 lines · On Tue, 22 Mar 2011 12:04:39 +0900 Namhyung Kim <[email protected]> wrote:
2011-03-22 (i??), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 8 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>What is the benefit of this patch ?
Quoted 8 lines
Quoted 2 lines
-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 [email protected]. 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:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 20110322135619.90593f5d.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
2011-03-22 (화), 13:56 +0900, KAMEZAWA Hiroyuki:
Quoted 21 lines
Quoted 9 lines · On Tue, 22 Mar 2011 12:04:39 +0900 Namhyung Kim <[email protected]> wrote:
2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 8 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>What is the benefit of this patch ?
Quoted 8 lines
Quoted 2 lines
-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.
Quoted 8 lines
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.
Signature · 8 lines
Regards, Namhyung Kim _______________________________________________ Containers mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
In reply to KAMEZAWA Hiroyuki2011-03-22 (i??), 13:56 +0900, KAMEZAWA Hiroyuki:
Quoted 21 lines
Quoted 9 lines · On Tue, 22 Mar 2011 12:04:39 +0900 Namhyung Kim <[email protected]> wrote:
2011-03-22 (i??), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 8 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>What is the benefit of this patch ?
Quoted 8 lines
Quoted 2 lines
-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.
Quoted 8 lines
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.
Signature · 10 lines
Regards, Namhyung Kim -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
Quoted 27 lines · On Tue, 22 Mar 2011 19:06:57 +0900 Namhyung Kim <[email protected]> wrote:
2011-03-22 (화), 13:56 +0900, KAMEZAWA Hiroyuki:
Quoted 26 lines
Quoted 9 lines · On Tue, 22 Mar 2011 12:04:39 +0900 Namhyung Kim <[email protected]> wrote:
2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 8 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>What is the benefit of this patch ?
Quoted 8 lines
Quoted 2 lines
-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.
Quoted 7 lines
Quoted 3 lines
Thanks,
-KameOK, 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
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 3/3] memcg: move page-freeing code outside of lock
In reply to Namhyung KimQuoted 27 lines · On Tue, 22 Mar 2011 19:06:57 +0900 Namhyung Kim <[email protected]> wrote:
2011-03-22 (화), 13:56 +0900, KAMEZAWA Hiroyuki:
Quoted 26 lines
Quoted 9 lines · On Tue, 22 Mar 2011 12:04:39 +0900 Namhyung Kim <[email protected]> wrote:
2011-03-22 (화), 08:59 +0900, KAMEZAWA Hiroyuki:
Quoted 8 lines
Quoted 2 lines · On Fri, 18 Mar 2011 21:54:15 +0900 Namhyung Kim <[email protected]> wrote:
Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>What is the benefit of this patch ?
Quoted 8 lines
Quoted 2 lines
-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.
Quoted 7 lines
Quoted 3 lines
Thanks,
-KameOK, 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
A message that is not in the archive (sent off-list or not yet received): 20110323133614.95553de8.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org
PATCH 1/1 memcg: move page-freeing code out of lock
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.
--- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-)
mm/page_cgroup.c +13 -9
@@ -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
Signature · 1 line
1.7.4
PATCH 1/1 memcg: move page-freeing code out of lock
In reply to KAMEZAWA HiroyukiMove 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.
--- mm/page_cgroup.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-)
mm/page_cgroup.c +13 -9
@@ -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
Signature · 1 line
1.7.4
A message that is not in the archive (sent off-list or not yet received): 1300881558-13523-1-git-send-email-namhyung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
KAMEZAWA Hiroyuki
Acked-byRe: [PATCH] memcg: move page-freeing code out of lock
Quoted 10 lines · On Wed, 23 Mar 2011 20:59:18 +0900 Namhyung Kim…
Move page-freeing code out of
swap_cgroup_mutexin 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 <[email protected]>Cc Paul Menage <[email protected]>Cc Li Zefan <[email protected]>Cc containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Re: [PATCH] memcg: move page-freeing code out of lock
In reply to Namhyung KimQuoted 10 lines · On Wed, 23 Mar 2011 20:59:18 +0900 Namhyung Kim <[email protected]> wrote:
Move page-freeing code out of
swap_cgroup_mutexin 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 <[email protected]>Cc Paul Menage <[email protected]>Cc Li Zefan <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>
Quoted 7 lines · On Fri, 18 Mar 2011 21:54:13 +0900 Namhyung Kim <[email protected]> wrote:
The commit
ca371c0d7e23("memcg: fixpage_cgroupfatal error in FLATMEM") removes call toalloc_bootmem()in the function so that it can be marked as__meminitto reduce memory usage when MEMORY_HOTPLUG=n.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
Quoted 22 lines
--- mm/page_cgroup.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)mm/page_cgroup.c +1
-2@@ -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;Signature · 1 line
1.7.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 20110322085755.c4193fc1.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org
Balbir Singh
Acked-byQuoted 11 lines · KAMEZAWA Hiroyuki
Quoted 7 lines · On Fri, 18 Mar 2011 21:54:13 +0900 Namhyung Kim…
The commit
ca371c0d7e23("memcg: fixpage_cgroupfatal error in FLATMEM") removes call toalloc_bootmem()in the function so that it can be marked as__meminitto reduce memory usage when MEMORY_HOTPLUG=n.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
Balbir Singh
Acked-byQuoted 11 lines · KAMEZAWA Hiroyuki
Quoted 7 lines · On Fri, 18 Mar 2011 21:54:13 +0900 Namhyung Kim <[email protected]> wrote:
The commit
ca371c0d7e23("memcg: fixpage_cgroupfatal error in FLATMEM") removes call toalloc_bootmem()in the function so that it can be marked as__meminitto reduce memory usage when MEMORY_HOTPLUG=n.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>
2011-03-18 (e,?), 21:54 +0900, Namhyung Kim:
Quoted 16 lines
The commit
ca371c0d7e23("memcg: fixpage_cgroupfatal error in FLATMEM") removes call toalloc_bootmem()in the function so that it can be marked as__meminitto reduce memory usage when MEMORY_HOTPLUG=n.Signed-off-by Namhyung Kim <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>--- mm/page_cgroup.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)mm/page_cgroup.c +0
-0
mm/page_cgroup.c struct page_cgroup *lookup_page_cgroup(struct page *page) · line 111
Quoted 9 lines
mm/page_cgroup.c +1
-2@@ -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.
Signature · 10 lines
Regards, Namhyung Kim -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>