From: "Satoshi UCHIDA" <s-uchida@ap.jp.nec.com>
To: <linux-kernel@vger.kernel.org>,
<containers@lists.linux-foundation.org>,
<virtualization@lists.linux-foundation.org>,
<jens.axboe@oracle.com>, "'Ryo Tsuruta'" <ryov@valinux.co.jp>,
"'Andrea Righi'" <righi.andrea@gmail.com>, <ngupta@google.com>,
<fernando@oss.ntt.co.jp>, <vtaras@openvz.org>
Cc: "'Andrew Morton'" <akpm@linux-foundation.org>,
"'SUGAWARA Tomoyoshi'" <tom-sugawara@ap.jp.nec.com>,
<menage@google.com>, <balbir@linux.vnet.ibm.com>
Subject: [PATCH][cfq-cgroups][12/12] Interface for parameter of cfq driver data
Date: Wed, 12 Nov 2008 17:31:39 +0900 [thread overview]
Message-ID: <001901c944a1$15798a40$406c9ec0$@jp.nec.com> (raw)
In-Reply-To: <000c01c9449e$c5bcdc20$51369460$@jp.nec.com>
>From 8bdb6a318fbc266cf359aea699c97a964baeff35 Mon Sep 17 00:00:00 2001
From: Satoshi UCHIDA <s-uchida@ap.jp.nec.com>
Date: Fri, 31 Oct 2008 20:49:57 +0900
Subject: [PATCH][cfq-cgroups] Interface for parameter of cfq driver data
This patch add a interface for parameter of cfq driver data.
Signed-off-by: Satoshi UCHIDA <s-uchida@ap.jp.nec.com>
---
block/cfq-cgroup.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 58 insertions(+), 1 deletions(-)
diff --git a/block/cfq-cgroup.c b/block/cfq-cgroup.c
index 4938fa0..776874d 100644
--- a/block/cfq-cgroup.c
+++ b/block/cfq-cgroup.c
@@ -1028,6 +1028,62 @@ STORE_FUNCTION(cfq_cgroup_slice_async_rq_store, cfq_slice_async_rq, 1,
STORE_FUNCTION(cfq_cgroup_ioprio_store, ioprio, 0, CFQ_CGROUP_MAX_IOPRIO, 0);
#undef STORE_FUNCTION
+static ssize_t
+cfq_cgroup_var_show2(unsigned int var, char *page)
+{
+ return snprintf(page, PAGE_SIZE, "%d\n", var);
+}
+
+static ssize_t
+cfq_cgroup_var_store2(unsigned int *var, const char *page, size_t count)
+{
+ int err;
+ char *p = (char *) page;
+ unsigned long new_var;
+
+ err = strict_strtoul(p, 10, &new_var);
+ if (err)
+ count = 0;
+
+ *var = new_var;
+
+ return count;
+}
+
+#define SHOW_FUNCTION2(__FUNC, __VAR, __CONV) \
+static ssize_t __FUNC(elevator_t *e, char *page) \
+{ \
+ struct cfq_data *cfqd = e->elevator_data; \
+ struct cfq_driver_data *cfqdd = cfqd->cfqdd; \
+ unsigned int __data = __VAR; \
+ if (__CONV) \
+ __data = jiffies_to_msecs(__data); \
+ return cfq_cgroup_var_show2(__data, (page)); \
+}
+SHOW_FUNCTION2(cfq_cgroup_slice_cgroup_show, cfqdd->cfq_cgroup_slice, 1);
+#undef SHOW_FUNCTION2
+
+#define STORE_FUNCTION2(__FUNC, __PTR, MIN, MAX, __CONV) \
+static ssize_t __FUNC(elevator_t *e, const char *page, size_t count) \
+{ \
+ struct cfq_data *cfqd = e->elevator_data; \
+ struct cfq_driver_data *cfqdd = cfqd->cfqdd; \
+ unsigned int __data; \
+ int ret = cfq_cgroup_var_store2(&__data, (page), count); \
+ if (__data < (MIN)) \
+ __data = (MIN); \
+ else if (__data > (MAX)) \
+ __data = (MAX); \
+ if (__CONV) \
+ *(__PTR) = msecs_to_jiffies(__data); \
+ else \
+ *(__PTR) = __data; \
+ return ret; \
+}
+STORE_FUNCTION2(cfq_cgroup_slice_cgroup_store, &cfqdd->cfq_cgroup_slice, 1,
+ UINT_MAX, 1);
+#undef STORE_FUNCTION2
+
#define CFQ_CGROUP_ATTR(name) \
__ATTR(name, S_IRUGO|S_IWUSR, cfq_cgroup_##name##_show, \
cfq_cgroup_##name##_store)
@@ -1043,6 +1099,7 @@ static struct elv_fs_entry cfq_cgroup_attrs[] = {
CFQ_CGROUP_ATTR(slice_async_rq),
CFQ_CGROUP_ATTR(slice_idle),
CFQ_CGROUP_ATTR(ioprio),
+ CFQ_CGROUP_ATTR(slice_cgroup),
__ATTR_NULL
};
--
1.5.6.5
next prev parent reply other threads:[~2008-11-12 8:38 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-12 8:15 [PATCH][RFC][12+2][v3] A expanded CFQ scheduler for cgroups Satoshi UCHIDA
2008-11-12 8:15 ` Satoshi UCHIDA
2008-11-12 8:23 ` [PATCH][cfq-cgroups][01/12] Move basic strcture variable to header file Satoshi UCHIDA
2008-11-12 8:23 ` Satoshi UCHIDA
2008-11-12 8:23 ` Satoshi UCHIDA
2008-11-12 8:24 ` [PATCH][cfq-cgroups][02/12] Introduce "cfq_driver_data" structure Satoshi UCHIDA
2008-11-12 8:24 ` Satoshi UCHIDA
2008-11-12 8:24 ` Satoshi UCHIDA
2008-11-12 8:25 ` [PATCH][cfq-cgroups][03/12] Add cgroup file and modify configure files Satoshi UCHIDA
2008-11-12 8:25 ` Satoshi UCHIDA
2008-11-12 8:25 ` Satoshi UCHIDA
2008-11-12 8:26 ` [PATCH][cfq-cgroups][04/12] Register or unregister "cfq-cgroups" module Satoshi UCHIDA
2008-11-12 8:26 ` Satoshi UCHIDA
2008-11-12 8:26 ` Satoshi UCHIDA
2008-11-12 8:26 ` [PATCH][cfq-cgroups][05/12] Introduce cgroups structure with ioprio entry Satoshi UCHIDA
2008-11-12 8:26 ` Satoshi UCHIDA
2008-11-12 8:26 ` Satoshi UCHIDA
2008-11-12 8:27 ` [PATCH][cfq-cgroups][06/12] Add siblings tree control for driver data(cfq_driver_data) Satoshi UCHIDA
2008-11-12 8:27 ` Satoshi UCHIDA
2008-11-12 8:27 ` Satoshi UCHIDA
2008-11-12 8:28 ` [PATCH][cfq-cgroups][07/12] Add sibling tree control for group data(cfq_cgroup) Satoshi UCHIDA
2008-11-12 8:28 ` Satoshi UCHIDA
2008-11-12 8:28 ` Satoshi UCHIDA
2008-11-12 8:29 ` [PATCH][cfq-cgroups][08/12] Interface to new cfq data structure in cfq_cgroup module Satoshi UCHIDA
2008-11-12 8:29 ` Satoshi UCHIDA
2008-11-12 8:29 ` Satoshi UCHIDA
2008-11-12 8:29 ` [PATCH][cfq-cgroups][09/12] Develop service tree control Satoshi UCHIDA
2008-11-12 8:29 ` Satoshi UCHIDA
2008-11-12 8:29 ` Satoshi UCHIDA
2008-11-12 8:30 ` [PATCH][cfq-cgroups][10/12] Introduce request control for two layer Satoshi UCHIDA
2008-11-12 8:30 ` Satoshi UCHIDA
2008-11-12 8:30 ` Satoshi UCHIDA
2008-11-12 8:31 ` [PATCH][cfq-cgroups][11/12] Expand idle slice timer function Satoshi UCHIDA
2008-11-12 8:31 ` Satoshi UCHIDA
2008-11-12 8:31 ` Satoshi UCHIDA
2008-11-12 8:31 ` Satoshi UCHIDA [this message]
2008-11-12 8:31 ` [PATCH][cfq-cgroups][12/12] Interface for parameter of cfq driver data Satoshi UCHIDA
2008-11-12 8:31 ` Satoshi UCHIDA
2008-11-12 8:37 ` [PATCH][cfq-cgroups][Option 1] Introduce a think time valid entry Satoshi UCHIDA
2008-11-12 8:37 ` Satoshi UCHIDA
2008-11-12 8:37 ` Satoshi UCHIDA
2008-11-12 8:37 ` [PATCH][cfq-cgroups][Option 2] Introduce ioprio class for top layer Satoshi UCHIDA
2008-11-12 8:37 ` Satoshi UCHIDA
2008-11-12 8:37 ` Satoshi UCHIDA
2008-11-12 8:57 ` [PATCH][RFC][12+2][v3] A expanded CFQ scheduler for cgroups Peter Zijlstra
2008-11-12 9:22 ` Satoshi UCHIDA
2008-11-12 9:22 ` Satoshi UCHIDA
2008-11-12 9:22 ` Satoshi UCHIDA
2008-11-12 8:57 ` Peter Zijlstra
2008-11-12 8:57 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001901c944a1$15798a40$406c9ec0$@jp.nec.com' \
--to=s-uchida@ap.jp.nec.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=containers@lists.linux-foundation.org \
--cc=fernando@oss.ntt.co.jp \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=ngupta@google.com \
--cc=righi.andrea@gmail.com \
--cc=ryov@valinux.co.jp \
--cc=tom-sugawara@ap.jp.nec.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=vtaras@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.