summaryrefslogtreecommitdiffstats
path: root/mm/page_cgroup.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-06-17 16:27:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 13:03:47 -0700
commit338c843108bf5030d6765f4405126e70f8b77845 (patch)
treec3bdab2f288e4c5a843ea07e0f8938a821ab848a /mm/page_cgroup.c
parent302362c5abdda80b5c2e4e57be610c2e3c2ab3c5 (diff)
downloadlinux-stable-338c843108bf5030d6765f4405126e70f8b77845.tar.gz
linux-stable-338c843108bf5030d6765f4405126e70f8b77845.tar.bz2
linux-stable-338c843108bf5030d6765f4405126e70f8b77845.zip
memcg: remove some redundant checks
We don't need to check do_swap_account in the case that the function which checks do_swap_account will never get called if do_swap_account == 0. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_cgroup.c')
-rw-r--r--mm/page_cgroup.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 672089d5819f..f22b4ebbd8dc 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -311,8 +311,6 @@ static int swap_cgroup_prepare(int type)
struct swap_cgroup_ctrl *ctrl;
unsigned long idx, max;
- if (!do_swap_account)
- return 0;
ctrl = &swap_cgroup_ctrl[type];
for (idx = 0; idx < ctrl->length; idx++) {
@@ -349,9 +347,6 @@ unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id)
struct swap_cgroup *sc;
unsigned short old;
- if (!do_swap_account)
- return 0;
-
ctrl = &swap_cgroup_ctrl[type];
mappage = ctrl->map[idx];
@@ -380,9 +375,6 @@ unsigned short lookup_swap_cgroup(swp_entry_t ent)
struct swap_cgroup *sc;
unsigned short ret;
- if (!do_swap_account)
- return 0;
-
ctrl = &swap_cgroup_ctrl[type];
mappage = ctrl->map[idx];
sc = page_address(mappage);