Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1374508 > unrolled thread

[PATCH] mm: memcontrol: let v2 cgroups follow changes in system swappiness

Started byJohannes Weiner <hannes@cmpxchg.org>
First post2016-04-09 00:50 +0200
Last post2016-04-11 09:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm: memcontrol: let v2 cgroups follow changes in system swappiness Johannes Weiner <hannes@cmpxchg.org> - 2016-04-09 00:50 +0200
    Re: [PATCH] mm: memcontrol: let v2 cgroups follow changes in system  swappiness Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-04-09 11:00 +0200
    Re: [PATCH] mm: memcontrol: let v2 cgroups follow changes in system  swappiness Michal Hocko <mhocko@kernel.org> - 2016-04-11 09:40 +0200

#1374508 — [PATCH] mm: memcontrol: let v2 cgroups follow changes in system swappiness

FromJohannes Weiner <hannes@cmpxchg.org>
Date2016-04-09 00:50 +0200
Subject[PATCH] mm: memcontrol: let v2 cgroups follow changes in system swappiness
Message-ID<rlNnY-35Z-11@gated-at.bofh.it>
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>
Cc: stable@vger.kernel.org # 4.5
---
 include/linux/swap.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/swap.h b/include/linux/swap.h
index e58dba3..15d17c8 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -534,6 +534,10 @@ static inline swp_entry_t get_swap_page(void)
 #ifdef CONFIG_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 ? */
 	if (mem_cgroup_disabled() || !memcg->css.parent)
 		return vm_swappiness;
-- 
2.8.0

[toc] | [next] | [standalone]


#1374591 — Re: [PATCH] mm: memcontrol: let v2 cgroups follow changes in system swappiness

FromVladimir Davydov <vdavydov@virtuozzo.com>
Date2016-04-09 11:00 +0200
SubjectRe: [PATCH] mm: memcontrol: let v2 cgroups follow changes in system swappiness
Message-ID<rlWUh-2fn-3@gated-at.bofh.it>
In reply to#1374508
On Fri, Apr 08, 2016 at 06:49:04PM -0400, Johannes Weiner wrote:
> 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>
> Cc: stable@vger.kernel.org # 4.5

Acked-by: Vladimir Davydov <vdavydov@virtuozzo.com>

[toc] | [prev] | [next] | [standalone]


#1375541 — Re: [PATCH] mm: memcontrol: let v2 cgroups follow changes in system swappiness

FromMichal Hocko <mhocko@kernel.org>
Date2016-04-11 09:40 +0200
SubjectRe: [PATCH] mm: memcontrol: let v2 cgroups follow changes in system swappiness
Message-ID<rmEBY-26A-11@gated-at.bofh.it>
In reply to#1374508
On Fri 08-04-16 18:49:04, Johannes Weiner wrote:
> 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>
> Cc: stable@vger.kernel.org # 4.5

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  include/linux/swap.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/swap.h b/include/linux/swap.h
> index e58dba3..15d17c8 100644
> --- a/include/linux/swap.h
> +++ b/include/linux/swap.h
> @@ -534,6 +534,10 @@ static inline swp_entry_t get_swap_page(void)
>  #ifdef CONFIG_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 ? */
>  	if (mem_cgroup_disabled() || !memcg->css.parent)
>  		return vm_swappiness;
> -- 
> 2.8.0

-- 
Michal Hocko
SUSE Labs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web