Hello All,
I'm very glad to tell you that ckrm on powepc architecture works as expected.
We did lot of trial and erorr with various patches and finally settled down with
1. cpurc-v0.5-2617 and
2. res_group_f0.8_single_2617.patch, we downgraded both of them for 2.6.14
kernel.
we faced no major problems except,sometimes kernel refuses to boot but we could
resolve the same by shifting to a new patch.
Some compilation errors and we fixed it with "#define CONFIG_RES_GROUPS" at
include/res_groups.h
apart from that, everything went smooth. We found ckrm tools are very
old,interacting with proc interface which never worked with us. so changed it a
bit. Following is the pattch for tools to measure the cpu time which works with
configfs interface(only for class and throughput.c, we have not tested
interactivity yet..)
diff -Naur measure.orig/Makefile measure/Makefile
--- measure.orig/Makefile 2003-07-23 00:13:59.000000000 +0900
+++ measure/Makefile 2006-12-19 00:09:17.000000000 +0900
@@ -3,7 +3,7 @@
KERNELDIR=/usr
CC= gcc
-CFLAGS = -g -Wall
+CFLAGS = -g -Wall -O
EXES = throughput interactive
diff -Naur measure.orig/class.c measure/class.c
--- measure.orig/class.c 2003-07-23 00:12:00.000000000 +0900
+++ measure/class.c 2006-12-20 19:42:23.000000000 +0900
@@ -1,9 +1,28 @@
#include "class.h"
+#define CLASS_DIR "/config/res_group/"
/*
return 0 on succeed
return -1 on failure
*/
+
+int create_class(int class_id)
+{
+ char buff[100];
+
+ sprintf (buff,"%s%d",CLASS_DIR,class_id);
+
+ if (mkdir(buff, S_IRUSR | S_IWUSR) == -1)
+ {
+ perror("Cannot create the dir\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+#if 0
+/*Old interface*/
int set_class(pid_t pid,int class_id) {
FILE * class_proc = fopen("/proc/classes","w");
if (class_proc) {
@@ -16,9 +35,36 @@
return 0;
}
+#endif
+
+int set_class(pid_t pid, int class_id)
+{
+ char buff[100];
+ int fd;
+ int len;
+ sprintf (buff,"%s%d/members",CLASS_DIR,class_id);
+ fd = open(buff,O_RDWR);
+
+ len = sprintf(buff,"%d",pid);
+ if ( fd < 0)
+ {
+ perror("Cannot create class\n");
+ return -1;
+ }
+
+ write(fd, buff, len);
+
+ close(fd);
+
+ return 0;
+
+}
+
/*
return -1 on error
*/
+#if 0
+/*Old Interface*/
int get_class(int pid) {
char name[32];
@@ -40,7 +86,7 @@
}
}
-
+#endif
int get_interactive(int pid) {
char name[32];
diff -Naur measure.orig/class.h measure/class.h
--- measure.orig/class.h 2003-07-23 00:12:00.000000000 +0900
+++ measure/class.h 2006-12-20 19:42:32.000000000 +0900
@@ -1,9 +1,13 @@
#include <stdio.h>
#include <stdlib.h>
+#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
int set_class(pid_t pid,int class_id);
-int get_class(int pid);
int get_interactive(int pid);
+int create_class(int class_id);
+
diff -Naur measure.orig/throughput.c measure/throughput.c
--- measure.orig/throughput.c 2003-07-23 00:12:00.000000000 +0900
+++ measure/throughput.c 2006-12-20 19:45:08.000000000 +0900
@@ -1,6 +1,7 @@
/*
the program is used to do throughput test
*/
+
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
@@ -24,6 +25,18 @@
int tick = 0;
int measure_time = (60*30); //900s
+int get_class(pid_t pid)
+{
+ int i=0;
+ while ( i<PROCESS_NUM )
+ {
+ if ( pids[i] == pid )
+ return (i%CLASS_NUM)+1;
+ }
+
+ return -1;
+}
+
static void sig_cont(int sig) {
pid_t pid = getpid();
@@ -64,6 +77,12 @@
}
+ /*Creating Classes*/
+ for ( i =0; i<CLASS_NUM;i++)
+ if (create_class(i+1) == -1 )
+ exit(1);
+
+
//generate the processes
for (i = 0; i < PROCESS_NUM; i++) {
class = i % CLASS_NUM + 1;
@@ -93,6 +112,8 @@
//sleep for some time
sleep(measure_time+SYNC_DELAY);
fprintf(stderr,"...sleep finished\n");
+ for ( i=0;i<PROCESS_NUM;i++)
+ printf("%d,",pids[i]);
//send kill to all the childs
for (i = 0; i < PROCESS_NUM; i++) {
kill(pids[i],SIGUSR1);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech