mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 10:29:37 +00:00
mm: memcontrol: let v2 cgroups follow changes in system swappiness
Cgroup2 currently doesn't have a per-cgroup swappiness setting. We might want to add one later - that's a different discussion - but until we do, the cgroups should always follow the system setting. Otherwise it will be unchangeably set to whatever the ancestor inherited from the system setting at the time of cgroup creation. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Vladimir Davydov <vdavydov@virtuozzo.com> Cc: <stable@vger.kernel.org> [4.5] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
145bdaa150
commit
4550c4e157
1 changed files with 4 additions and 0 deletions
|
@ -533,6 +533,10 @@ static inline swp_entry_t get_swap_page(void)
|
||||||
#ifdef CONFIG_MEMCG
|
#ifdef CONFIG_MEMCG
|
||||||
static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg)
|
static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg)
|
||||||
{
|
{
|
||||||
|
/* Cgroup2 doesn't have per-cgroup swappiness */
|
||||||
|
if (cgroup_subsys_on_dfl(memory_cgrp_subsys))
|
||||||
|
return vm_swappiness;
|
||||||
|
|
||||||
/* root ? */
|
/* root ? */
|
||||||
if (mem_cgroup_disabled() || !memcg->css.parent)
|
if (mem_cgroup_disabled() || !memcg->css.parent)
|
||||||
return vm_swappiness;
|
return vm_swappiness;
|
||||||
|
|
Loading…
Reference in a new issue