lkml.org 
[lkml]   [2009]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC][PATCH 3/4] memcg: add accessor to mem_cgroup.css
So that one can check its cgroup id and free the reference count
grabbed by try_get_mem_cgroup_from_page().

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
include/linux/memcontrol.h | 7 +++++++
mm/memcontrol.c | 6 ++++++
2 files changed, 13 insertions(+)

--- linux-mm.orig/include/linux/memcontrol.h 2009-08-31 15:25:48.000000000 +0800
+++ linux-mm/include/linux/memcontrol.h 2009-08-31 15:27:00.000000000 +0800
@@ -81,6 +81,8 @@ int mm_match_cgroup(const struct mm_stru
return cgroup == mem;
}

+extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem);
+
extern int
mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr);
extern void mem_cgroup_end_migration(struct mem_cgroup *mem,
@@ -206,6 +208,11 @@ static inline int task_in_mem_cgroup(str
return 1;
}

+static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem)
+{
+ return NULL;
+}
+
static inline int
mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr)
{
--- linux-mm.orig/mm/memcontrol.c 2009-08-31 15:25:48.000000000 +0800
+++ linux-mm/mm/memcontrol.c 2009-08-31 15:25:52.000000000 +0800
@@ -282,6 +282,12 @@ mem_cgroup_zoneinfo(struct mem_cgroup *m
return &mem->info.nodeinfo[nid]->zoneinfo[zid];
}

+struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem)
+{
+ return &mem->css;
+}
+EXPORT_SYMBOL(mem_cgroup_css);
+
static struct mem_cgroup_per_zone *
page_cgroup_zoneinfo(struct page_cgroup *pc)
{
--



\
 
 \ /
  Last update: 2009-08-31 12:47    [W:0.069 / U:1.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site