diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2011-03-23 19:42:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-23 22:46:29 -0400 |
commit | bf1ff2635a5fda207fc870df348bfc766e8dcd4d (patch) | |
tree | d4085b3bdbe608f6c8f708cb93080051b341d7fe /mm | |
parent | 4dc03de1b29901b61cb27e4cab44a7f578dc0fc9 (diff) |
memcg: remove memcg->reclaim_param_lock
The reclaim_param_lock is only taken around single reads and writes to
integer variables and is thus superfluous. Drop it.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b35a28d80ab5..8f9381976c59 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -218,12 +218,6 @@ struct mem_cgroup { | |||
218 | * per zone LRU lists. | 218 | * per zone LRU lists. |
219 | */ | 219 | */ |
220 | struct mem_cgroup_lru_info info; | 220 | struct mem_cgroup_lru_info info; |
221 | |||
222 | /* | ||
223 | protect against reclaim related member. | ||
224 | */ | ||
225 | spinlock_t reclaim_param_lock; | ||
226 | |||
227 | /* | 221 | /* |
228 | * While reclaiming in a hierarchy, we cache the last child we | 222 | * While reclaiming in a hierarchy, we cache the last child we |
229 | * reclaimed from. | 223 | * reclaimed from. |
@@ -1130,17 +1124,12 @@ static unsigned long long mem_cgroup_margin(struct mem_cgroup *mem) | |||
1130 | static unsigned int get_swappiness(struct mem_cgroup *memcg) | 1124 | static unsigned int get_swappiness(struct mem_cgroup *memcg) |
1131 | { | 1125 | { |
1132 | struct cgroup *cgrp = memcg->css.cgroup; | 1126 | struct cgroup *cgrp = memcg->css.cgroup; |
1133 | unsigned int swappiness; | ||
1134 | 1127 | ||
1135 | /* root ? */ | 1128 | /* root ? */ |
1136 | if (cgrp->parent == NULL) | 1129 | if (cgrp->parent == NULL) |
1137 | return vm_swappiness; | 1130 | return vm_swappiness; |
1138 | 1131 | ||
1139 | spin_lock(&memcg->reclaim_param_lock); | 1132 | return memcg->swappiness; |
1140 | swappiness = memcg->swappiness; | ||
1141 | spin_unlock(&memcg->reclaim_param_lock); | ||
1142 | |||
1143 | return swappiness; | ||
1144 | } | 1133 | } |
1145 | 1134 | ||
1146 | static void mem_cgroup_start_move(struct mem_cgroup *mem) | 1135 | static void mem_cgroup_start_move(struct mem_cgroup *mem) |
@@ -1356,13 +1345,11 @@ mem_cgroup_select_victim(struct mem_cgroup *root_mem) | |||
1356 | 1345 | ||
1357 | rcu_read_unlock(); | 1346 | rcu_read_unlock(); |
1358 | /* Updates scanning parameter */ | 1347 | /* Updates scanning parameter */ |
1359 | spin_lock(&root_mem->reclaim_param_lock); | ||
1360 | if (!css) { | 1348 | if (!css) { |
1361 | /* this means start scan from ID:1 */ | 1349 | /* this means start scan from ID:1 */ |
1362 | root_mem->last_scanned_child = 0; | 1350 | root_mem->last_scanned_child = 0; |
1363 | } else | 1351 | } else |
1364 | root_mem->last_scanned_child = found; | 1352 | root_mem->last_scanned_child = found; |
1365 | spin_unlock(&root_mem->reclaim_param_lock); | ||
1366 | } | 1353 | } |
1367 | 1354 | ||
1368 | return ret; | 1355 | return ret; |
@@ -3868,9 +3855,7 @@ static int mem_cgroup_swappiness_write(struct cgroup *cgrp, struct cftype *cft, | |||
3868 | return -EINVAL; | 3855 | return -EINVAL; |
3869 | } | 3856 | } |
3870 | 3857 | ||
3871 | spin_lock(&memcg->reclaim_param_lock); | ||
3872 | memcg->swappiness = val; | 3858 | memcg->swappiness = val; |
3873 | spin_unlock(&memcg->reclaim_param_lock); | ||
3874 | 3859 | ||
3875 | cgroup_unlock(); | 3860 | cgroup_unlock(); |
3876 | 3861 | ||
@@ -4526,7 +4511,6 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) | |||
4526 | res_counter_init(&mem->memsw, NULL); | 4511 | res_counter_init(&mem->memsw, NULL); |
4527 | } | 4512 | } |
4528 | mem->last_scanned_child = 0; | 4513 | mem->last_scanned_child = 0; |
4529 | spin_lock_init(&mem->reclaim_param_lock); | ||
4530 | INIT_LIST_HEAD(&mem->oom_notify); | 4514 | INIT_LIST_HEAD(&mem->oom_notify); |
4531 | 4515 | ||
4532 | if (parent) | 4516 | if (parent) |