summaryrefslogtreecommitdiff
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-05-14 05:45:59 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-05-14 05:45:59 -0300
commitc91265cd0efb83778f015b4d4b1129bd2cfd075e (patch)
treec9e2ebed36b5a70f0d7c58cb7e3d36e823ccde9f /include/linux/swap.h
parenta5cdf7364020a61375af3c8aa23e09181f5c2c6c (diff)
Linux-libre 4.5.4-gnupck-4.5.4-gnu
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 44324f10f..67f65075a 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -540,6 +540,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;