* [PATCH] mm: memcg: expose mem_cgroup_put API
@ 2018-03-08 2:48 Shakeel Butt
2018-03-08 23:40 ` Andrew Morton
2018-03-08 23:45 ` Andrew Morton
0 siblings, 2 replies; 4+ messages in thread
From: Shakeel Butt @ 2018-03-08 2:48 UTC (permalink / raw)
To: Roman Gushchin, Vladimir Davydov, Michal Hocko, Greg Thelen,
Johannes Weiner, Andrew Morton
Cc: linux-mm, linux-kernel, cgroups, Shakeel Butt
This patch exports mem_cgroup_put API to put the refcnt of the memory
cgroup.
Signed-off-by: Shakeel Butt <shakeelb@google.com>
---
include/linux/memcontrol.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index c46016bb25eb..0da79e116a07 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -344,6 +344,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)
@@ -789,6 +794,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,
--
2.16.2.395.g2e18187dfd-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mm: memcg: expose mem_cgroup_put API
2018-03-08 2:48 [PATCH] mm: memcg: expose mem_cgroup_put API Shakeel Butt
@ 2018-03-08 23:40 ` Andrew Morton
2018-03-08 23:45 ` Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2018-03-08 23:40 UTC (permalink / raw)
To: Shakeel Butt
Cc: Roman Gushchin, Vladimir Davydov, Michal Hocko, Greg Thelen,
Johannes Weiner, linux-mm, linux-kernel, cgroups
On Wed, 7 Mar 2018 18:48:50 -0800 Shakeel Butt <shakeelb@google.com> wrote:
> This patch exports mem_cgroup_put API to put the refcnt of the memory
> cgroup.
Not the best of changelogs :(
Why is this patch being added?
It's a prerequisite for <I-forget-which-patch> isn't it?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm: memcg: expose mem_cgroup_put API
2018-03-08 2:48 [PATCH] mm: memcg: expose mem_cgroup_put API Shakeel Butt
2018-03-08 23:40 ` Andrew Morton
@ 2018-03-08 23:45 ` Andrew Morton
2018-03-08 23:48 ` Shakeel Butt
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2018-03-08 23:45 UTC (permalink / raw)
To: Shakeel Butt
Cc: Roman Gushchin, Vladimir Davydov, Michal Hocko, Greg Thelen,
Johannes Weiner, linux-mm, linux-kernel, cgroups, David Rientjes
On Wed, 7 Mar 2018 18:48:50 -0800 Shakeel Butt <shakeelb@google.com> wrote:
> This patch exports mem_cgroup_put API to put the refcnt of the memory
> cgroup.
OK, I remember now. This is intended to make
fs-fsnotify-account-fsnotify-metadata-to-kmemcg.patch independent of
mm-oom-cgroup-aware-oom-killer.patch by extracting mem_cgroup_put()
from mm-oom-cgroup-aware-oom-killer.patch.
However it will not permit me to stage
fs-fsnotify-account-fsnotify-metadata-to-kmemcg.patch ahead of
mm-oom-cgroup-aware-oom-killer.patch because there are quite a lot of
syntactic clashes.
I can resolve those if needed, but am keenly hoping that the
mm-oom-cgroup-aware-oom-killer.patch issues are resolved soon so there
isn't a need to do this.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm: memcg: expose mem_cgroup_put API
2018-03-08 23:45 ` Andrew Morton
@ 2018-03-08 23:48 ` Shakeel Butt
0 siblings, 0 replies; 4+ messages in thread
From: Shakeel Butt @ 2018-03-08 23:48 UTC (permalink / raw)
To: Andrew Morton
Cc: Roman Gushchin, Vladimir Davydov, Michal Hocko, Greg Thelen,
Johannes Weiner, Linux MM, LKML, Cgroups, David Rientjes
On Thu, Mar 8, 2018 at 3:45 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Wed, 7 Mar 2018 18:48:50 -0800 Shakeel Butt <shakeelb@google.com> wrote:
>
>> This patch exports mem_cgroup_put API to put the refcnt of the memory
>> cgroup.
>
> OK, I remember now. This is intended to make
> fs-fsnotify-account-fsnotify-metadata-to-kmemcg.patch independent of
> mm-oom-cgroup-aware-oom-killer.patch by extracting mem_cgroup_put()
> from mm-oom-cgroup-aware-oom-killer.patch.
Yes, you are right, it is needed by the above fsnotify patch.
> However it will not permit me to stage
> fs-fsnotify-account-fsnotify-metadata-to-kmemcg.patch ahead of
> mm-oom-cgroup-aware-oom-killer.patch because there are quite a lot of
> syntactic clashes.
>
> I can resolve those if needed, but am keenly hoping that the
> mm-oom-cgroup-aware-oom-killer.patch issues are resolved soon so there
> isn't a need to do this.
>
Sounds good to me.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-03-08 23:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08 2:48 [PATCH] mm: memcg: expose mem_cgroup_put API Shakeel Butt
2018-03-08 23:40 ` Andrew Morton
2018-03-08 23:45 ` Andrew Morton
2018-03-08 23:48 ` Shakeel Butt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.