The patch titled Subject: mm: introduce mem_cgroup_put() helper has been added to the -mm tree. Its filename is mm-introduce-mem_cgroup_put-helper.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-introduce-mem_cgroup_put-helper.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-introduce-mem_cgroup_put-helper.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Roman Gushchin <guro@xxxxxx> Subject: mm: introduce mem_cgroup_put() helper 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/20180623000600.5818-2-guro@xxxxxx Signed-off-by: Roman Gushchin <guro@xxxxxx> Reviewed-by: Shakeel Butt <shakeelb@xxxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Shakeel Butt <shakeelb@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN include/linux/memcontrol.h~mm-introduce-mem_cgroup_put-helper include/linux/memcontrol.h --- a/include/linux/memcontrol.h~mm-introduce-mem_cgroup_put-helper +++ a/include/linux/memcontrol.h @@ -375,6 +375,11 @@ struct mem_cgroup *mem_cgroup_from_css(s 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) @@ -837,6 +842,10 @@ static inline bool task_in_mem_cgroup(st 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, _ Patches currently in -mm which might be from guro@xxxxxx are mm-introduce-mem_cgroup_put-helper.patch mm-oom-refactor-the-oom_kill_process-function.patch mm-implement-mem_cgroup_scan_tasks-for-the-root-memory-cgroup.patch mm-oom-cgroup-aware-oom-killer.patch mm-oom-cgroup-aware-oom-killer-fix-3.patch mm-oom-introduce-memoryoom_group.patch mm-oom-introduce-memoryoom_group-fix.patch mm-oom-add-cgroup-v2-mount-option-for-cgroup-aware-oom-killer.patch mm-oom-docs-describe-the-cgroup-aware-oom-killer.patch mm-oom-docs-describe-the-cgroup-aware-oom-killer-fix.patch cgroup-list-groupoom-in-cgroup-features.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html