linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH mmotm] memcg: avoid reclaim_stat oops when disabled
  2008-12-23  1:24 [PATCH mmotm] memcg: avoid reclaim_stat oops when disabled Hugh Dickins
@ 2008-12-23  1:23 ` KAMEZAWA Hiroyuki
  2008-12-23  1:29 ` KOSAKI Motohiro
  1 sibling, 0 replies; 3+ messages in thread
From: KAMEZAWA Hiroyuki @ 2008-12-23  1:23 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: Andrew Morton, KOSAKI Motohiro, linux-mm

On Tue, 23 Dec 2008 01:24:56 +0000 (GMT)
Hugh Dickins <hugh@veritas.com> wrote:

> mem_cgroup_get_reclaim_stat_from_page() oopses in page_cgroup_zoneinfo()
> when you boot with cgroup_disabled=memory: it needs to check for that.
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>

Oh, thanks.

Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

> ---
> Follow memcg-add-zone_reclaim_stat-reclaim-stat-trivial-fixes.patch
> 
>  mm/memcontrol.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> --- mmotm/mm/memcontrol.c	2008-12-16 18:05:31.000000000 +0000
> +++ fixed/mm/memcontrol.c	2008-12-16 19:30:02.000000000 +0000
> @@ -496,9 +496,14 @@ struct zone_reclaim_stat *mem_cgroup_get
>  struct zone_reclaim_stat *
>  mem_cgroup_get_reclaim_stat_from_page(struct page *page)
>  {
> -	struct page_cgroup *pc = lookup_page_cgroup(page);
> -	struct mem_cgroup_per_zone *mz = page_cgroup_zoneinfo(pc);
> +	struct page_cgroup *pc;
> +	struct mem_cgroup_per_zone *mz;
>  
> +	if (mem_cgroup_disabled())
> +		return NULL;
> +
> +	pc = lookup_page_cgroup(page);
> +	mz = page_cgroup_zoneinfo(pc);
>  	if (!mz)
>  		return NULL;
>  
> 
> --
> 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/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
> 

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH mmotm] memcg: avoid reclaim_stat oops when disabled
@ 2008-12-23  1:24 Hugh Dickins
  2008-12-23  1:23 ` KAMEZAWA Hiroyuki
  2008-12-23  1:29 ` KOSAKI Motohiro
  0 siblings, 2 replies; 3+ messages in thread
From: Hugh Dickins @ 2008-12-23  1:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: KOSAKI Motohiro, linux-mm

mem_cgroup_get_reclaim_stat_from_page() oopses in page_cgroup_zoneinfo()
when you boot with cgroup_disabled=memory: it needs to check for that.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
Follow memcg-add-zone_reclaim_stat-reclaim-stat-trivial-fixes.patch

 mm/memcontrol.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- mmotm/mm/memcontrol.c	2008-12-16 18:05:31.000000000 +0000
+++ fixed/mm/memcontrol.c	2008-12-16 19:30:02.000000000 +0000
@@ -496,9 +496,14 @@ struct zone_reclaim_stat *mem_cgroup_get
 struct zone_reclaim_stat *
 mem_cgroup_get_reclaim_stat_from_page(struct page *page)
 {
-	struct page_cgroup *pc = lookup_page_cgroup(page);
-	struct mem_cgroup_per_zone *mz = page_cgroup_zoneinfo(pc);
+	struct page_cgroup *pc;
+	struct mem_cgroup_per_zone *mz;
 
+	if (mem_cgroup_disabled())
+		return NULL;
+
+	pc = lookup_page_cgroup(page);
+	mz = page_cgroup_zoneinfo(pc);
 	if (!mz)
 		return NULL;
 

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH mmotm] memcg: avoid reclaim_stat oops when disabled
  2008-12-23  1:24 [PATCH mmotm] memcg: avoid reclaim_stat oops when disabled Hugh Dickins
  2008-12-23  1:23 ` KAMEZAWA Hiroyuki
@ 2008-12-23  1:29 ` KOSAKI Motohiro
  1 sibling, 0 replies; 3+ messages in thread
From: KOSAKI Motohiro @ 2008-12-23  1:29 UTC (permalink / raw)
  To: Hugh Dickins, KAMEZAWA Hiroyuki; +Cc: kosaki.motohiro, Andrew Morton, linux-mm

>  struct zone_reclaim_stat *
>  mem_cgroup_get_reclaim_stat_from_page(struct page *page)
>  {
> -	struct page_cgroup *pc = lookup_page_cgroup(page);
> -	struct mem_cgroup_per_zone *mz = page_cgroup_zoneinfo(pc);
> +	struct page_cgroup *pc;
> +	struct mem_cgroup_per_zone *mz;
>  
> +	if (mem_cgroup_disabled())
> +		return NULL;
> +
> +	pc = lookup_page_cgroup(page);
> +	mz = page_cgroup_zoneinfo(pc);
>  	if (!mz)
>  		return NULL;

Oops, really thanks.
this patch is defenitly needed and corrent.

	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>


Kamezawa-san, I think memcg_test.txt should describe "cgroup_disabled=memory"
too. What do you think it?


--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-23  1:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-23  1:24 [PATCH mmotm] memcg: avoid reclaim_stat oops when disabled Hugh Dickins
2008-12-23  1:23 ` KAMEZAWA Hiroyuki
2008-12-23  1:29 ` KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox