projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a9b4b3
)
mm: introduce mem_cgroup_put() helper
author
Roman Gushchin
<
[email protected]
>
Fri, 17 Aug 2018 22:46:36 +0000
(15:46 -0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 17 Aug 2018 23:20:29 +0000
(16:20 -0700)
Introduce the mem_cgroup_put() helper, which helps to eliminate guarding
memcg css release with "#ifdef CONFIG_MEMCG" in multiple places.
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Roman Gushchin <
[email protected]
>
Reviewed-by: Shakeel Butt <
[email protected]
>
Reviewed-by: Andrew Morton <
[email protected]
>
Acked-by: Johannes Weiner <
[email protected]
>
Acked-by: Michal Hocko <
[email protected]
>
Acked-by: David Rientjes <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
include/linux/memcontrol.h
patch
|
blob
|
history
diff --git
a/include/linux/memcontrol.h
b/include/linux/memcontrol.h
index 680d3395fc838269870fb836664826fa296cc9e9..42f4719def3205cfc77284507665da719954e132 100644
(file)
--- a/
include/linux/memcontrol.h
+++ b/
include/linux/memcontrol.h
@@
-378,6
+378,11
@@
struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css){
return css ? container_of(css, struct mem_cgroup, css) : NULL;
}
+static inline void mem_cgroup_put(struct mem_cgroup *memcg)
+{
+ css_put(&memcg->css);
+}
+
#define mem_cgroup_from_counter(counter, member) \
container_of(counter, struct mem_cgroup, member)
@@
-850,6
+855,10
@@
static inline bool task_in_mem_cgroup(struct task_struct *task,
return true;
}
+static inline void mem_cgroup_put(struct mem_cgroup *memcg)
+{
+}
+
static inline struct mem_cgroup *
mem_cgroup_iter(struct mem_cgroup *root,
struct mem_cgroup *prev,