Commit bf1ff2635a5fda207fc870df348bfc766e8dcd4d

Authored by Johannes Weiner
Committed by Linus Torvalds
1 parent 4dc03de1b2

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>

Showing 1 changed file with 1 additions and 17 deletions Side-by-side Diff

... ... @@ -218,13 +218,7 @@
218 218 * per zone LRU lists.
219 219 */
220 220 struct mem_cgroup_lru_info info;
221   -
222 221 /*
223   - protect against reclaim related member.
224   - */
225   - spinlock_t reclaim_param_lock;
226   -
227   - /*
228 222 * While reclaiming in a hierarchy, we cache the last child we
229 223 * reclaimed from.
230 224 */
231 225  
... ... @@ -1130,17 +1124,12 @@
1130 1124 static unsigned int get_swappiness(struct mem_cgroup *memcg)
1131 1125 {
1132 1126 struct cgroup *cgrp = memcg->css.cgroup;
1133   - unsigned int swappiness;
1134 1127  
1135 1128 /* root ? */
1136 1129 if (cgrp->parent == NULL)
1137 1130 return vm_swappiness;
1138 1131  
1139   - spin_lock(&memcg->reclaim_param_lock);
1140   - swappiness = memcg->swappiness;
1141   - spin_unlock(&memcg->reclaim_param_lock);
1142   -
1143   - return swappiness;
  1132 + return memcg->swappiness;
1144 1133 }
1145 1134  
1146 1135 static void mem_cgroup_start_move(struct mem_cgroup *mem)
1147 1136  
... ... @@ -1356,13 +1345,11 @@
1356 1345  
1357 1346 rcu_read_unlock();
1358 1347 /* Updates scanning parameter */
1359   - spin_lock(&root_mem->reclaim_param_lock);
1360 1348 if (!css) {
1361 1349 /* this means start scan from ID:1 */
1362 1350 root_mem->last_scanned_child = 0;
1363 1351 } else
1364 1352 root_mem->last_scanned_child = found;
1365   - spin_unlock(&root_mem->reclaim_param_lock);
1366 1353 }
1367 1354  
1368 1355 return ret;
1369 1356  
... ... @@ -3868,9 +3855,7 @@
3868 3855 return -EINVAL;
3869 3856 }
3870 3857  
3871   - spin_lock(&memcg->reclaim_param_lock);
3872 3858 memcg->swappiness = val;
3873   - spin_unlock(&memcg->reclaim_param_lock);
3874 3859  
3875 3860 cgroup_unlock();
3876 3861  
... ... @@ -4526,7 +4511,6 @@
4526 4511 res_counter_init(&mem->memsw, NULL);
4527 4512 }
4528 4513 mem->last_scanned_child = 0;
4529   - spin_lock_init(&mem->reclaim_param_lock);
4530 4514 INIT_LIST_HEAD(&mem->oom_notify);
4531 4515  
4532 4516 if (parent)