mm/memcg: add BUG() to mem_cgroup_reset
Subsystems (3)
PATCH 1/1 mm/memcg: add BUG() to mem_cgroup_reset
From: Wanpeng Li <[email protected]>
Branch in mem_cgroup_reset only can be RES_MAX_USAGE, RES_FAILCNT.
--- mm/memcontrol.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
mm/memcontrol.c +2 -0
@@ -3976,6 +3976,8 @@ static int mem_cgroup_reset(struct cgroup *cont, unsigned int event)else res_counter_reset_failcnt (&memcg->memsw);break ; +default : +BUG (); }return 0 ;
Signature · 7 lines
1.7.5.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/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 14 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Branch in
mem_cgroup_resetonly can beRES_MAX_USAGE,RES_FAILCNT.Signed-off-by Wanpeng Li <[email protected]>---
mm/memcontrol.c| 2 ++1 files changed, 2 insertions(+), 0 deletions(-)mm/memcontrol.c +0
-0
mm/memcontrol.c static int mem_cgroup_reset(struct cgroup *cont, unsigned int event) · line 3980
Quoted 5 lines
mm/memcontrol.c +2
-0@@ -3976,6 +3976,8 @@ static int mem_cgroup_reset(struct cgroup *cont, unsigned int event)else res_counter_reset_failcnt (&memcg->memsw);break ; +default : +BUG ();
It might be not convinced to have "BUG()" here. You might add something for debugging purpose. For example,
default: printk(KERN_WARNING "%s: Unrecognized name %d\n", __func__, name);
Thanks,
Gavin
Quoted 12 lines
mm/memcontrol.c +0
-0}return 0 ;Signature · 7 lines
1.7.5.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/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 23 lines · Gavin Shan
Quoted 14 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Branch in
mem_cgroup_resetonly can beRES_MAX_USAGE,RES_FAILCNT.Signed-off-by Wanpeng Li <[email protected]>---
mm/memcontrol.c| 2 ++1 files changed, 2 insertions(+), 0 deletions(-)mm/memcontrol.c +0
-0mm/memcontrol.c static int mem_cgroup_reset(struct cgroup *cont, unsigned int event) · line 3980
Quoted 5 lines
mm/memcontrol.c +2
-0@@ -3976,6 +3976,8 @@ static int mem_cgroup_reset(struct cgroup *cont, unsigned int event)else res_counter_reset_failcnt (&memcg->memsw);break ; +default : +BUG ();It might be not convinced to have "
BUG()" here. You might add something for debugging purpose. For example,
Quoted 3 lines
default: printk(KERN_WARNING "%s: Unrecognized name %d\n", __func__, name);
But many funtions in mm/memcontrol.c use BUG(), if the branch is not present.
Regards,
Wanpeng Li
Quoted 17 lines
Thanks,
GavinQuoted 12 lines
mm/memcontrol.c +0
-0}return 0 ;Signature · 7 lines
1.7.5.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/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 5 lines
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Johannes Weiner
maintainerQuoted 3 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Branch in
mem_cgroup_resetonly can beRES_MAX_USAGE,RES_FAILCNT.
And nobody is passing anything else. Which is easy to prove as this is a private function. And there wouldn't even be any harm passing something else. Please don't add stuff like this.
Quoted 8 lines · Johannes Weiner
Quoted 3 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Branch in
mem_cgroup_resetonly can beRES_MAX_USAGE,RES_FAILCNT.And nobody is passing anything else. Which is easy to prove as this is a private function. And there wouldn't even be any harm passing something else. Please don't add stuff like this.
Ok, thank you for your comment.
I also have another two patches, title:
clarify type in memory cgroups
return -EBUSY when oom-kill-disable modified and memcg use_hierarchy, has children
Hopefully, you can review. Thank you Johannes! :-)
Regards,
Wanpeng Li
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>