Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1184696

[PATCH 2/5] memcg: get rid of mem_cgroup_root_css for !CONFIG_MEMCG

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 2/5] memcg: get rid of mem_cgroup_root_css for !CONFIG_MEMCG
Date 2015-07-15 13:20 +0200
Message-ID <pMsTg-5QQ-31@gated-at.bofh.it> (permalink)
References <pMsTf-5QQ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The only user is cgwb_bdi_init and that one depends on
CONFIG_CGROUP_WRITEBACK which in turn depends on CONFIG_MEMCG
so it doesn't make much sense to definte an empty stub for
!CONFIG_MEMCG. Moreover ERR_PTR(-EINVAL) is ugly and would lead
to runtime crashes if used in unguarded code paths. Better fail
during compilation.

Reviewed-by: Vladimir Davydov <vdavydov@parallels.com>
Signed-off-by: Michal Hocko <mhocko@kernel.org>
---
 include/linux/memcontrol.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 42f118ae04cf..292e6701f3fd 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -497,8 +497,6 @@ void mem_cgroup_split_huge_fixup(struct page *head);
 #else /* CONFIG_MEMCG */
 struct mem_cgroup;
 
-#define mem_cgroup_root_css ((struct cgroup_subsys_state *)ERR_PTR(-EINVAL))
-
 static inline void mem_cgroup_events(struct mem_cgroup *memcg,
 				     enum mem_cgroup_events_index idx,
 				     unsigned int nr)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] expose mem_cgroup + cleanups Michal Hocko <mhocko@kernel.org> - 2015-07-15 13:20 +0200
  [PATCH 3/5] memcg: get rid of extern for functions in memcontrol.h Michal Hocko <mhocko@kernel.org> - 2015-07-15 13:20 +0200
  [PATCH 2/5] memcg: get rid of mem_cgroup_root_css for !CONFIG_MEMCG Michal Hocko <mhocko@kernel.org> - 2015-07-15 13:20 +0200
  [PATCH 5/5] memcg, tcp_kmem: check for cg_proto in sock_update_memcg Michal Hocko <mhocko@kernel.org> - 2015-07-15 13:20 +0200
  Re: [PATCH 1/5] memcg: export struct mem_cgroup Andrew Morton <akpm@linux-foundation.org> - 2015-07-15 23:00 +0200
    Re: [PATCH 1/5] memcg: export struct mem_cgroup Andrew Morton <akpm@linux-foundation.org> - 2015-07-16 23:40 +0200
      Re: [PATCH 1/5] memcg: export struct mem_cgroup Johannes Weiner <hannes@cmpxchg.org> - 2015-07-17 01:00 +0200
        Re: [PATCH 1/5] memcg: export struct mem_cgroup Andrew Morton <akpm@linux-foundation.org> - 2015-07-17 01:10 +0200
          Re: [PATCH 1/5] memcg: export struct mem_cgroup Johannes Weiner <hannes@cmpxchg.org> - 2015-07-17 14:30 +0200

csiph-web