* Re: [RESEND] [PATCH] memcg: Fix build warning and avoid checking for mem != null again and again
2009-05-28 8:50 [RESEND] [PATCH] memcg: Fix build warning and avoid checking for mem != null again and again Nikanth Karthikesan
@ 2009-05-28 8:49 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-05-28 8:49 UTC (permalink / raw)
To: Nikanth Karthikesan
Cc: Andrew Morton, balbir, Pavel Emelyanov, linux-mm, linux-kernel,
Pekka Enberg
On Thu, 28 May 2009 14:20:43 +0530
Nikanth Karthikesan <knikanth@suse.de> wrote:
>
> Resending the patch to Andrew for inclusion in -mm tree.
>
> Thanks
> Nikanth
>
> Fix build warning, "mem_cgroup_is_obsolete defined but not used" when
> CONFIG_DEBUG_VM is not set. Also avoid checking for !mem again and again.
>
> Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> ---
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 01c2d8f..d253846 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -314,14 +314,6 @@ static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
> return mem;
> }
>
> -static bool mem_cgroup_is_obsolete(struct mem_cgroup *mem)
> -{
> - if (!mem)
> - return true;
> - return css_is_removed(&mem->css);
> -}
> -
> -
> /*
> * Call callback function against all cgroup under hierarchy tree.
> */
> @@ -932,7 +924,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
> if (unlikely(!mem))
> return 0;
>
> - VM_BUG_ON(!mem || mem_cgroup_is_obsolete(mem));
> + VM_BUG_ON(css_is_removed(&mem->css));
>
> while (1) {
> int ret;
>
>
> --
> 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] 2+ messages in thread
* [RESEND] [PATCH] memcg: Fix build warning and avoid checking for mem != null again and again
@ 2009-05-28 8:50 Nikanth Karthikesan
2009-05-28 8:49 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 2+ messages in thread
From: Nikanth Karthikesan @ 2009-05-28 8:50 UTC (permalink / raw)
To: Andrew Morton
Cc: balbir, Pavel Emelyanov, KAMEZAWA Hiroyuki, linux-mm,
linux-kernel, Pekka Enberg
Resending the patch to Andrew for inclusion in -mm tree.
Thanks
Nikanth
Fix build warning, "mem_cgroup_is_obsolete defined but not used" when
CONFIG_DEBUG_VM is not set. Also avoid checking for !mem again and again.
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 01c2d8f..d253846 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -314,14 +314,6 @@ static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
return mem;
}
-static bool mem_cgroup_is_obsolete(struct mem_cgroup *mem)
-{
- if (!mem)
- return true;
- return css_is_removed(&mem->css);
-}
-
-
/*
* Call callback function against all cgroup under hierarchy tree.
*/
@@ -932,7 +924,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
if (unlikely(!mem))
return 0;
- VM_BUG_ON(!mem || mem_cgroup_is_obsolete(mem));
+ VM_BUG_ON(css_is_removed(&mem->css));
while (1) {
int ret;
--
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] 2+ messages in thread
end of thread, other threads:[~2009-05-28 8:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-28 8:50 [RESEND] [PATCH] memcg: Fix build warning and avoid checking for mem != null again and again Nikanth Karthikesan
2009-05-28 8:49 ` KAMEZAWA Hiroyuki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox