lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1547232913-118148-1-git-send-email-yang.shi@linux.alibaba.com>
Date:   Sat, 12 Jan 2019 02:55:13 +0800
From:   Yang Shi <yang.shi@...ux.alibaba.com>
To:     ying.huang@...el.com, tim.c.chen@...el.com,
        akpm@...ux-foundation.org
Cc:     yang.shi@...ux.alibaba.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] mm: swap: use mem_cgroup_is_root() instead of deferencing css->parent

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@...el.com>
Cc: Tim Chen <tim.c.chen@...el.com>
Signed-off-by: Yang Shi <yang.shi@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ