Thread: [Linux-hls-cvs] cbs/src Makefile,1.1.1.1,1.2 cbs.c,1.3,1.4 hooks.c,1.1.1.1,1.2 init.c,1.1.1.1,1.2 ti
Status: Pre-Alpha
Brought to you by:
lucabe
|
From: Luca A. <lu...@us...> - 2004-08-21 13:51:39
|
Update of /cvsroot/linux-hls/cbs/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5943 Modified Files: Makefile cbs.c hooks.c init.c timers.c Log Message: - Update to the new gensched interface - New "generic" timing code, based on sys_gettimeofday Index: init.c =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** init.c 21 Feb 2004 13:06:37 -0000 1.1.1.1 --- init.c 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 28,33 **** extern void generic_register(struct task_struct *t); extern void generic_unregister(struct task_struct *t); ! extern int generic_setsched(pid_t pid, int policy, struct sched_param *param); ! extern int generic_getsched(pid_t pid, struct sched_param *param); --- 28,33 ---- extern void generic_register(struct task_struct *t); extern void generic_unregister(struct task_struct *t); ! extern int generic_setsched(struct task_struct *t, int policy, struct sched_param *param); ! extern int generic_getsched(struct task_struct *t, struct sched_param *param); Index: hooks.c =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/hooks.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** hooks.c 21 Feb 2004 13:06:36 -0000 1.1.1.1 --- hooks.c 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 20,23 **** --- 20,24 ---- #include <scheduler.h> #include <dispatch.h> + #include <muldiv.h> #include <time.h> *************** *** 40,62 **** #endif ! static inline struct task_struct *find_process_by_pid(pid_t pid) ! { ! struct task_struct *tsk = current; ! ! if (pid) { ! tsk = find_task_by_pid(pid); ! } ! ! return tsk; ! } ! ! int cbs_get_params(int pid, unsigned long int *qs, unsigned long int *ts) { struct cbs_struct *cbs; - struct task_struct *p; unsigned long flags; spin_lock_irqsave(&generic_scheduler_lock, flags); - p = find_process_by_pid(pid); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); --- 41,50 ---- #endif ! int cbs_get_params(struct task_struct *p, unsigned long int *qs, unsigned long int *ts) { struct cbs_struct *cbs; unsigned long flags; spin_lock_irqsave(&generic_scheduler_lock, flags); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); *************** *** 76,87 **** return 0; } ! int cbs_set_params(int pid, unsigned long int qs, unsigned long int ts) { struct cbs_struct *cbs; - struct task_struct *p; unsigned long flags; spin_lock_irqsave(&generic_scheduler_lock, flags); - p = find_process_by_pid(pid); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); --- 64,73 ---- return 0; } ! int cbs_set_params(struct task_struct *p, unsigned long int qs, unsigned long int ts) { struct cbs_struct *cbs; unsigned long flags; spin_lock_irqsave(&generic_scheduler_lock, flags); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); *************** *** 96,100 **** #ifdef QOSDBG cprintf("<changing period> Task (pid %d) changed from %d to %d\n", ! pid, p->oldp, p->per); cprintf(" (quantum is %d)\n", cbs->max_budget); #endif --- 82,86 ---- #ifdef QOSDBG cprintf("<changing period> Task (pid %d) changed from %d to %d\n", ! p->pid, p->oldp, p->per); cprintf(" (quantum is %d)\n", cbs->max_budget); #endif *************** *** 109,113 **** #ifdef QOSDBG cprintf(" Task %d changed capacity from %d (%d) to %d\n", ! pid, p->oldq, ce.max_budget, p->q); #endif cbs->max_budget = qs; --- 95,99 ---- #ifdef QOSDBG cprintf(" Task %d changed capacity from %d (%d) to %d\n", ! p->pid, p->oldq, ce.max_budget, p->q); #endif cbs->max_budget = qs; *************** *** 245,251 **** * > 0 ---> do the regular Linux thing... */ ! int generic_getsched(pid_t pid, struct sched_param *sp) { - struct task_struct *p; struct cbs_error cbs_e; struct sched_param_new sched_p, *param; --- 231,236 ---- * > 0 ---> do the regular Linux thing... */ ! int generic_getsched(struct task_struct *p, struct sched_param *sp) { struct cbs_error cbs_e; struct sched_param_new sched_p, *param; *************** *** 258,262 **** spin_lock_irqsave(&generic_scheduler_lock, flags); - p = find_process_by_pid(pid); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); --- 243,246 ---- *************** *** 304,308 **** } ! int generic_setsched(pid_t pid, int policy, struct sched_param *sp) { unsigned long int t, q; --- 288,292 ---- } ! int generic_setsched(struct task_struct *p, int policy, struct sched_param *sp) { unsigned long int t, q; *************** *** 312,316 **** #endif struct cbs_struct *cbs; - struct task_struct *p; struct cbs_param cbs_p; struct sched_param_new sched_p; --- 296,299 ---- *************** *** 323,327 **** spin_lock_irqsave(&generic_scheduler_lock, flags); debug_code = 5; - p = find_process_by_pid(pid); if (p == NULL) { debug_code = 0; --- 306,309 ---- Index: timers.c =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/timers.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** timers.c 21 Feb 2004 13:06:36 -0000 1.1.1.1 --- timers.c 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 18,21 **** --- 18,22 ---- #include <timers.h> + #include <muldiv.h> #include <time.h> Index: Makefile =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 21 Feb 2004 13:06:34 -0000 1.1.1.1 --- Makefile 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 6,11 **** ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) CPPFLAGS += -D__KERNEL__ -DMODULE -I$(KERNEL_DIR)/include -I./include ! CFLAGS += -Wall -Wstrict-prototypes -O2 -g ifeq ($(ARCH), ppc) CFLAGS += -g -msoft-float -ffixed-r2 -mmultiple -mstring --- 6,12 ---- ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) + TARCH := $(ARCH) CPPFLAGS += -D__KERNEL__ -DMODULE -I$(KERNEL_DIR)/include -I./include ! CFLAGS += -Wall -Wstrict-prototypes -O2 -g -fno-strict-aliasing ifeq ($(ARCH), ppc) CFLAGS += -g -msoft-float -ffixed-r2 -mmultiple -mstring *************** *** 51,55 **** ! all: include/time.h cbs_sched.o OBJS = cbs.o dispatch.o hooks.o init.o --- 52,56 ---- ! all: include/muldiv.h include/time.h cbs_sched.o OBJS = cbs.o dispatch.o hooks.o init.o *************** *** 80,85 **** $(GENKSYMS) -k2.4.0 < tmp > $@ ! include/time.h: include/$(ARCH)-time.h ! ln -s $(ARCH)-time.h include/time.h cbs_sched.o: $(OBJS) --- 81,89 ---- $(GENKSYMS) -k2.4.0 < tmp > $@ ! include/time.h: include/$(TARCH)-time.h ! ln -s $(TARCH)-time.h include/time.h ! ! include/muldiv.h: include/$(ARCH)-muldiv.h ! ln -s $(ARCH)-muldiv.h include/muldiv.h cbs_sched.o: $(OBJS) Index: cbs.c =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/cbs.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cbs.c 20 Jun 2004 13:11:31 -0000 1.3 --- cbs.c 21 Aug 2004 13:51:27 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- #include <linux/list.h> #include <linux/slab.h> + #include <muldiv.h> #include <time.h> *************** *** 23,27 **** #endif - static unsigned long long int prev_exec_set_time = 0; static unsigned long long int last_update_time = 0; --- 24,27 ---- *************** *** 335,339 **** sched_print(" Selected CBS %p (task %d)\n", new_exec, new_exec->task->pid); #endif ! sched_print(" Setting timer in %ld ticks\n", new_exec->c); #endif --- 335,339 ---- sched_print(" Selected CBS %p (task %d)\n", new_exec, new_exec->task->pid); #endif ! sched_print(" Setting timer in %Ld ticks\n", new_exec->c); #endif *************** *** 449,453 **** } else { #ifdef __CBS_DEBUG__ ! sched_print(" Setting timer in %ld ticks\n", t->c); #endif #ifdef __GRUB__ --- 449,453 ---- } else { #ifdef __CBS_DEBUG__ ! sched_print(" Setting timer in %Ld ticks\n", t->c); #endif #ifdef __GRUB__ *************** *** 633,637 **** --- 633,643 ---- #ifdef __CBS_GET_ERROR__ + #ifdef __CBS_DEBUG__ + sched_print("Mallocing...\n"); + #endif arrival = kmalloc(sizeof(struct arrival_list), GFP_ATOMIC); + #ifdef __CBS_DEBUG__ + sched_print("done: %p\n", arrival); + #endif if (!arrival) { sched_print("Failed to allocate an arrival stuff: allocated = %d\n", t->allocated_act); *************** *** 653,656 **** --- 659,665 ---- trace_activation(t, r); #endif + #ifdef __CBS_DEBUG__ + sched_print("New DL?\n"); + #endif /* CBS test: c > (d - r) * U ---> New deadline */ if ((t->c > llimd(t->deadline - r, t->max_budget_clock, t->period_clock)) || *************** *** 660,664 **** t->c = t->max_budget_clock; #ifdef __CBS_DEBUG__ ! sched_print(" New budget %ld\n",t->c); sched_print(" New Deadline %Ld\n", t->deadline); #endif --- 669,673 ---- t->c = t->max_budget_clock; #ifdef __CBS_DEBUG__ ! sched_print(" New budget %Ld\n",t->c); sched_print(" New Deadline %Ld\n", t->deadline); #endif *************** *** 670,673 **** --- 679,685 ---- res = 0; + #ifdef __CBS_DEBUG__ + sched_print(" Adding to list..."); + #endif if (edf_list_add(t, 1)) { #ifdef __CBS_DEBUG__ |