[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C36954A.5050501@ds.jp.nec.com>
Date: Thu, 08 Jul 2010 23:19:38 -0400
From: Munehiro Ikeda <m-ikeda@...jp.nec.com>
To: linux-kernel@...r.kernel.org, jens.axboe@...cle.com,
Vivek Goyal <vgoyal@...hat.com>
CC: Munehiro Ikeda <m-ikeda@...jp.nec.com>,
Ryo Tsuruta <ryov@...inux.co.jp>, taka@...inux.co.jp,
kamezawa.hiroyu@...fujitsu.com,
Andrea Righi <righi.andrea@...il.com>,
Gui Jianfeng <guijianfeng@...fujitsu.com>,
akpm@...ux-foundation.org, balbir@...ux.vnet.ibm.com
Subject: [RFC][PATCH 08/11] blkiocg async: Function to search blkcg from css
ID
iotrack stores css ID of blkcg in page_cgroup. The blkcg is what
the process which dirtied the page belongs to.
This patch introduces a function to search blkcg from the recorded
ID.
Signed-off-by: Munehiro "Muuhh" Ikeda <m-ikeda@...jp.nec.com>
---
block/blk-cgroup.c | 13 +++++++++++++
block/blk-cgroup.h | 1 +
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index a680964..0756910 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -408,6 +408,19 @@ struct blkio_group *blkiocg_lookup_group(struct blkio_cgroup *blkcg, void *key)
}
EXPORT_SYMBOL_GPL(blkiocg_lookup_group);
+/* called under rcu_read_lock(). */
+struct blkio_cgroup *blkiocg_id_to_blkcg(unsigned short id)
+{
+ struct cgroup_subsys_state *css;
+
+ css = css_lookup(&blkio_subsys, id);
+ if (!css)
+ return NULL;
+
+ return container_of(css, struct blkio_cgroup, css);
+}
+EXPORT_SYMBOL_GPL(blkiocg_id_to_blkcg);
+
#define SHOW_FUNCTION(__VAR) \
static u64 blkiocg_##__VAR##_read(struct cgroup *cgroup, \
struct cftype *cftype) \
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 2b866ec..75c73bd 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -216,6 +216,7 @@ extern void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
extern int blkiocg_del_blkio_group(struct blkio_group *blkg);
extern struct blkio_group *blkiocg_lookup_group(struct blkio_cgroup *blkcg,
void *key);
+extern struct blkio_cgroup *blkiocg_id_to_blkcg(unsigned short id);
void blkiocg_update_timeslice_used(struct blkio_group *blkg,
unsigned long time);
void blkiocg_update_dispatch_stats(struct blkio_group *blkg, uint64_t bytes,
--
1.6.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists