From: maeda.naoaki@jp.fujitsu.com
To: linux-kernel@vger.kernel.org, ckrm-tech@lists.sourceforge.net
Cc: maeda.naoaki@jp.fujitsu.com
Subject: [RFC][PATCH 4/9] CPU controller - Adds interface functions
Date: Fri, 21 Apr 2006 11:27:48 +0900 [thread overview]
Message-ID: <20060421022748.13598.96502.sendpatchset@moscone.dvs.cs.fujitsu.co.jp> (raw)
In-Reply-To: <20060421022727.13598.15397.sendpatchset@moscone.dvs.cs.fujitsu.co.jp>
4/9: cpurc_interface
Adds interface functions to CKRM CPU controller.
Signed-off-by: Kurosawa Takahiro <kurosawa@valinux.co.jp>
Signed-off-by: MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>
include/linux/cpu_rc.h | 6 ++++++
kernel/cpu_rc.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
Index: linux-2.6.17-rc2/kernel/cpu_rc.c
===================================================================
--- linux-2.6.17-rc2.orig/kernel/cpu_rc.c
+++ linux-2.6.17-rc2/kernel/cpu_rc.c
@@ -232,3 +232,48 @@ void cpu_rc_detect_hunger(task_t *tsk)
tsk->last_activated = 0;
}
+
+void cpu_rc_clear_stat(struct cpu_rc *cr, int cpu)
+{
+ cr->stat[cpu].timestamp = 0;
+ cr->stat[cpu].load = 0;
+ cr->stat[cpu].maybe_hungry = 0;
+}
+
+void cpu_rc_init_cr(struct cpu_rc *cr, struct cpu_rc_domain *rcd)
+{
+ cr->rcd = rcd;
+ cr->share = 0;
+ cr->ts_factor = CPU_RC_TSFACTOR_MAX;
+}
+
+void cpu_rc_get_cr(struct cpu_rc *cr)
+{
+ cpu_rcd_lock(cr);
+ cr->rcd->numcrs++;
+ cpu_rcd_unlock(cr);
+}
+
+void cpu_rc_put_cr(struct cpu_rc *cr)
+{
+ cpu_rcd_lock(cr);
+ cr->is_hungry = 0;
+ cr->rcd->numcrs--;
+ cpu_rcd_unlock(cr);
+}
+
+void cpu_rc_init_rcd(struct cpu_rc_domain *rcd)
+{
+ rcd->cpus = cpu_online_map;
+ spin_lock_init(&rcd->lock);
+ rcd->hungry_count = 0;
+ rcd->numcpus = cpus_weight(cpu_online_map);
+ rcd->numcrs = 0;
+}
+
+void cpu_rc_set_share(struct cpu_rc *cr, int val)
+{
+ cpu_rcd_lock(cr);
+ cr->share = val;
+ cpu_rcd_unlock(cr);
+}
Index: linux-2.6.17-rc2/include/linux/cpu_rc.h
===================================================================
--- linux-2.6.17-rc2.orig/include/linux/cpu_rc.h
+++ linux-2.6.17-rc2/include/linux/cpu_rc.h
@@ -52,6 +52,12 @@ extern unsigned int cpu_rc_load(struct c
extern unsigned int cpu_rc_scale_timeslice(task_t *, unsigned int);
extern void cpu_rc_account(task_t *, unsigned long);
extern void cpu_rc_detect_hunger(task_t *);
+extern void cpu_rc_clear_stat(struct cpu_rc *, int);
+extern void cpu_rc_init_cr(struct cpu_rc *, struct cpu_rc_domain *);
+extern void cpu_rc_get_cr(struct cpu_rc *);
+extern void cpu_rc_put_cr(struct cpu_rc *);
+extern void cpu_rc_init_rcd(struct cpu_rc_domain *);
+extern void cpu_rc_set_share(struct cpu_rc *, int);
static inline void cpu_rc_record_activated(task_t *tsk, unsigned long now)
{
next prev parent reply other threads:[~2006-04-21 2:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-21 2:27 [RFC][PATCH 0/9] CKRM CPU resource controller maeda.naoaki
2006-04-21 2:27 ` [RFC][PATCH 1/9] CPU controller - Adds class load estimation maeda.naoaki
2006-04-21 2:27 ` [RFC][PATCH 2/9] CPU controller - Adds class hungry detection maeda.naoaki
2006-04-21 2:27 ` [RFC][PATCH 3/9] CPU controller - Adds timeslice scaling maeda.naoaki
2006-04-21 8:17 ` Mike Galbraith
2006-04-21 8:56 ` MAEDA Naoaki
2006-04-21 11:50 ` [ckrm-tech] " Naoaki MAEDA
2006-04-21 12:03 ` Mike Galbraith
2006-04-21 11:53 ` Mike Galbraith
2006-04-21 2:27 ` maeda.naoaki [this message]
2006-04-21 2:27 ` [RFC][PATCH 5/9] CPU controller - Documents how the controller works maeda.naoaki
2006-04-23 7:13 ` Mike Galbraith
2006-04-24 6:25 ` [ckrm-tech] " MAEDA Naoaki
2006-04-24 9:49 ` Mike Galbraith
2006-04-21 2:27 ` [RFC][PATCH 6/9] CPU controller - Adds basic functions and registering the controller maeda.naoaki
2006-04-21 2:28 ` [RFC][PATCH 7/9] CPU controller - Adds routines to change share values and show stat maeda.naoaki
2006-04-21 2:28 ` [RFC][PATCH 8/9] CPU controller - Adds cpu hotplug notifier maeda.naoaki
2006-04-21 2:28 ` [RFC][PATCH 9/9] CPU controller - Documents how to use the controller maeda.naoaki
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=20060421022748.13598.96502.sendpatchset@moscone.dvs.cs.fujitsu.co.jp \
--to=maeda.naoaki@jp.fujitsu.com \
--cc=ckrm-tech@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox