linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Class-based Kernel Resource Management
@ 2003-08-29 19:51 Shailabh Nagar
  2003-09-03  1:54 ` NIWA Hideyuki
  0 siblings, 1 reply; 4+ messages in thread
From: Shailabh Nagar @ 2003-08-29 19:51 UTC (permalink / raw)
  To: LKML; +Cc: ckrm-tech

As promised at the Ottawa Linux Symposium presentation in July, here
is the first code drop for the Class-based Kernel Resource Management
project.

The Class-based Kernel Resource Management (CKRM)
project seeks to develop Linux kernel mechanisms providing
differentiated service to resources such as CPU time, memory pages,
I/O and incoming network bandwith based on user defined groups of
tasks called classes. Changes to the primary resource schedulers such
as O(1) (cpu), deadline/CFQ (I/O) , VM page manager (memory) and
inbound network connection managers will be explored and developed.

More details on the project can be found at

	http://ckrm.sf.net

including 

- the paper and presentation at the Ottawa Linux Symposium 2003
- current status
- patches, modules, user programs
- detailed description of individual components and
- results from the version that was talked about at OLS'03.


The current CKRM design consists of the following components:

1) Core patch: Kernel patch defining kernel API and hooks for the
classification module and individual resource (cpu,mem,io,net)
controllers.  

2) Classification and user API module: Loadable module implementing a
Rule-based Classification Engine (RBCE) and defining a user API to
CKRM. Requires the core patch.  


3) CPU controller: Kernel patch implementing class-based CPU
control.Requires the core patch and some classification module like
RBCE.  

4) Memory controller: Kernel patch for class-based control of physical
memory.  Requires the core patch and some classification module like
RBCE.

5) I/O controller: Design proposed in OLS. To be developed in
conjunction with Jens Axboe's next version of CFQ I/O scheduler.

6) Inbound network controller: Design proposed. In development.

The next few mail will contain the patches for 1),3) and 4), the module
for 2).


If you are interested in this project, please join the ckrm-tech mailing
list at 
	http://lists.sourceforge.net/lists/listinfo/ckrm-tech

You are also welcome to join as a developer by sending a mail to the
project admins
Hubertus Franke (frankeh@users.sf.net) and Shailabh Nagar
(nagar@users.sf.net).

CKRM has been jointly developed by a number of folks including
Hubertus Franke, Shailabh Nagar, Chandra Seetharaman, Jiantao Kong,
Haoqiang Zheng, Vivek Kashyap, Nivedita Singhvi and Jonghyuk Choi.

 

-- Shailabh



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] Class-based Kernel Resource Management
  2003-08-29 19:51 [RFC] Class-based Kernel Resource Management Shailabh Nagar
@ 2003-09-03  1:54 ` NIWA Hideyuki
  2003-09-03 19:20   ` Shailabh Nagar
  0 siblings, 1 reply; 4+ messages in thread
From: NIWA Hideyuki @ 2003-09-03  1:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: niwa.hideyuki, ckrm-tech

Hello.

I tried ckrm (Class-based Kernel Resource Management) patch. 
I am very interested in ckrm. 

However, I found the following problems. 

1) Both of ckcpu and ckmem could not be applied at the same time. 

 I corrected the patch by hand. 
 Is it impossible to use both at the same time?

2) When rbcemod of the module is compiled, "ckrm_cpu_change_class" 
   becomes an undeclared symbol. 

 I modified kernel source kernel/class.c and export "ckrm_cpu_change_class": 
        EXPORT_SYMBOL(ckrm_cpu_change_class);

3) The bash process newly executed dies one after another when rbadmin 
   is executed.

 The value of the argument "cls" of the "ckrm_cpu_change_class" 
 function might be NULL. 
 Therefore, the NULL pointer dereference occurs when it 
 starts changing the class of the bash process. 

best regards,
NIWA


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] Class-based Kernel Resource Management
  2003-09-03  1:54 ` NIWA Hideyuki
@ 2003-09-03 19:20   ` Shailabh Nagar
  2003-09-17  5:08     ` NIWA Hideyuki
  0 siblings, 1 reply; 4+ messages in thread
From: Shailabh Nagar @ 2003-09-03 19:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: ckrm-tech, niwa.hideyuki

NIWA Hideyuki wrote:

> Hello.
> 
> I tried ckrm (Class-based Kernel Resource Management) patch. 
> I am very interested in ckrm. 

Thanks for your interest and feedback.

> However, I found the following problems. 
> 
> 1) Both of ckcpu and ckmem could not be applied at the same time. 
>  I corrected the patch by hand. 
>  Is it impossible to use both at the same time?

No, it is the intent of the project to have all four controllers cpu, memory,
io and network to be usable simultaneously.

However, the supplied patches for each controller only assume the core patch
(ckcore) to have been applied. We'll try to provide rollups of all controllers
combined on the ckrm site once the combinations get tested (if you do that, please let us
know !)


> 2) When rbcemod of the module is compiled, "ckrm_cpu_change_class" 
>    becomes an undeclared symbol. 
> 
>  I modified kernel source kernel/class.c and export "ckrm_cpu_change_class": 
>         EXPORT_SYMBOL(ckrm_cpu_change_class);

Thanks. I'll add it to the next version.

> 3) The bash process newly executed dies one after another when rbadmin 
>    is executed.
> 
>  The value of the argument "cls" of the "ckrm_cpu_change_class" 
>  function might be NULL. 
>  Therefore, the NULL pointer dereference occurs when it 
>  starts changing the class of the bash process. 

Will check this out.


-Shailabh


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] Class-based Kernel Resource Management
  2003-09-03 19:20   ` Shailabh Nagar
@ 2003-09-17  5:08     ` NIWA Hideyuki
  0 siblings, 0 replies; 4+ messages in thread
From: NIWA Hideyuki @ 2003-09-17  5:08 UTC (permalink / raw)
  To: linux-kernel


I tried ckcpu patch. 
However, echo command did not return from the kernel 
when trying to create a new class through /proc I/F. 

	ex. echo 1 1 10 class1 > /proc/classes

Moreover, this process kept using CPU for a long time. 

And, I cannot put a process into the class. 

	ex. echo 1 5560 > /proc/classes

I checked the source of ckcpu(ckcpu-A01-2.6.0-test2) and 
made a simple patch as a workaround. 

This patch is quick Hack.:-)

best regards,
NIWA


diff -Nru linux-2.6.0-test2/kernel/class.c linux-2.6.0-test2-ckcpu/kernel/class.c
--- linux-2.6.0-test2/kernel/class.c	2003-09-17 10:27:30.137358992 +0900
+++ linux-2.6.0-test2-ckcpu/kernel/class.c	2003-09-17 10:29:15.844289096 +0900
@@ -825,6 +825,7 @@
 //	kfree(arg);
 }
 
+
 struct seq_operations classes_op = {
 	.start	= classes_start,
 	.next	= classes_next,
@@ -846,27 +847,39 @@
 {
 	char kbuf[MAX_CLASSES_WRITE+1];
 	char name[MAX_CLASSNAME_LEN];
-	int classid,weight;
+	int classid,weight,pid;
 	int cmd;
 	
 	if (count > MAX_CLASSES_WRITE)
 		return -EINVAL;
+
 	if (copy_from_user(&kbuf, buffer, count))
 		return -EFAULT;
-	kbuf[MAX_CLASSES_WRITE] = '\0'; 
 
-	if (sscanf(kbuf, "%d %d %d %s", &cmd, &classid, &weight, name) != 4)
-		return -EINVAL;
+	kbuf[MAX_CLASSES_WRITE] = '\0'; 
 
-	if (cmd == 1) {
-		__create_class(classid,name,weight,0);
-		return 0;
-	} 
+	sscanf(kbuf, "%d", &cmd);
 
-	if (cmd == 2) {
-		set_class(weight, classid);
+	switch (cmd) {
+	case 1:
+		if (sscanf(kbuf, "%d %d %d %s", &cmd, &classid, &weight, name) 
+								== 4) {
+			__create_class(classid,name,weight,0);
+			return strlen(kbuf);
+		} else {
+			return -EINVAL;
+		}
+	case 2:
+		if (sscanf(kbuf, "%d %d %d", &cmd, &classid, &pid) == 3) {
+			set_class(pid, classid);
+			return strlen(kbuf);
+		} else {
+			return -EINVAL;
+		}
+	default: 
+		return -EINVAL;
 	}
-
+		
 	return -1;
 }
 
@@ -951,6 +964,9 @@
 								
 void ckrm_cpu_change_class(struct task_struct *tsk,				
                                struct ckrm_cpu_class *cls) {		
+	if (cls == NULL) {
+		return;
+	}
 	set_class(tsk->pid,cls->class_id);
         tsk->cpu_class = cls;
 }							
@@ -960,3 +976,5 @@
 EXPORT_SYMBOL(ckrm_cpu_set_share);						
 EXPORT_SYMBOL(ckrm_cpu_get_usage);					
 EXPORT_SYMBOL(ckrm_dflt_cpu_class);
+EXPORT_SYMBOL(ckrm_cpu_change_class);
+


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-17  5:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-29 19:51 [RFC] Class-based Kernel Resource Management Shailabh Nagar
2003-09-03  1:54 ` NIWA Hideyuki
2003-09-03 19:20   ` Shailabh Nagar
2003-09-17  5:08     ` NIWA Hideyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).