lkml.org 
[lkml]   [2019]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm: swap: use mem_cgroup_is_root() instead of deferencing css->parent
Date
mem_cgroup_is_root() is preferred API to check if memcg is root or not.
Use it instead of deferencing css->parent.

Cc: Huang Ying <ying.huang@intel.com>
Cc: Tim Chen <tim.c.chen@intel.com>
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
---
include/linux/swap.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/swap.h b/include/linux/swap.h
index a8f6d5d..8739063 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -623,7 +623,7 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg)
return vm_swappiness;

/* root ? */
- if (mem_cgroup_disabled() || !memcg->css.parent)
+ if (mem_cgroup_disabled() || mem_cgroup_is_root(memcg))
return vm_swappiness;

return memcg->swappiness;
--
1.8.3.1
\
 
 \ /
  Last update: 2019-01-11 20:01    [W:0.067 / U:1.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site