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>
This commit is contained in:
parent
4dc03de1b2
commit
bf1ff2635a
|
@ -218,12 +218,6 @@ struct mem_cgroup {
|
||||||
* per zone LRU lists.
|
* per zone LRU lists.
|
||||||
*/
|
*/
|
||||||
struct mem_cgroup_lru_info info;
|
struct mem_cgroup_lru_info info;
|
||||||
|
|
||||||
/*
|
|
||||||
protect against reclaim related member.
|
|
||||||
*/
|
|
||||||
spinlock_t reclaim_param_lock;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* While reclaiming in a hierarchy, we cache the last child we
|
* While reclaiming in a hierarchy, we cache the last child we
|
||||||
* reclaimed from.
|
* reclaimed from.
|
||||||
|
@ -1130,17 +1124,12 @@ static unsigned long long mem_cgroup_margin(struct mem_cgroup *mem)
|
||||||
static unsigned int get_swappiness(struct mem_cgroup *memcg)
|
static unsigned int get_swappiness(struct mem_cgroup *memcg)
|
||||||
{
|
{
|
||||||
struct cgroup *cgrp = memcg->css.cgroup;
|
struct cgroup *cgrp = memcg->css.cgroup;
|
||||||
unsigned int swappiness;
|
|
||||||
|
|
||||||
/* root ? */
|
/* root ? */
|
||||||
if (cgrp->parent == NULL)
|
if (cgrp->parent == NULL)
|
||||||
return vm_swappiness;
|
return vm_swappiness;
|
||||||
|
|
||||||
spin_lock(&memcg->reclaim_param_lock);
|
return memcg->swappiness;
|
||||||
swappiness = memcg->swappiness;
|
|
||||||
spin_unlock(&memcg->reclaim_param_lock);
|
|
||||||
|
|
||||||
return swappiness;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mem_cgroup_start_move(struct mem_cgroup *mem)
|
static void mem_cgroup_start_move(struct mem_cgroup *mem)
|
||||||
|
@ -1356,13 +1345,11 @@ mem_cgroup_select_victim(struct mem_cgroup *root_mem)
|
||||||
|
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
/* Updates scanning parameter */
|
/* Updates scanning parameter */
|
||||||
spin_lock(&root_mem->reclaim_param_lock);
|
|
||||||
if (!css) {
|
if (!css) {
|
||||||
/* this means start scan from ID:1 */
|
/* this means start scan from ID:1 */
|
||||||
root_mem->last_scanned_child = 0;
|
root_mem->last_scanned_child = 0;
|
||||||
} else
|
} else
|
||||||
root_mem->last_scanned_child = found;
|
root_mem->last_scanned_child = found;
|
||||||
spin_unlock(&root_mem->reclaim_param_lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -3868,9 +3855,7 @@ static int mem_cgroup_swappiness_write(struct cgroup *cgrp, struct cftype *cft,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_lock(&memcg->reclaim_param_lock);
|
|
||||||
memcg->swappiness = val;
|
memcg->swappiness = val;
|
||||||
spin_unlock(&memcg->reclaim_param_lock);
|
|
||||||
|
|
||||||
cgroup_unlock();
|
cgroup_unlock();
|
||||||
|
|
||||||
|
@ -4526,7 +4511,6 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
|
||||||
res_counter_init(&mem->memsw, NULL);
|
res_counter_init(&mem->memsw, NULL);
|
||||||
}
|
}
|
||||||
mem->last_scanned_child = 0;
|
mem->last_scanned_child = 0;
|
||||||
spin_lock_init(&mem->reclaim_param_lock);
|
|
||||||
INIT_LIST_HEAD(&mem->oom_notify);
|
INIT_LIST_HEAD(&mem->oom_notify);
|
||||||
|
|
||||||
if (parent)
|
if (parent)
|
||||||
|
|
Loading…
Reference in New Issue