--- cpu_reserve.c Fri Feb 21 14:46:14 2003 +++ ../../LinuxRK.2.4/rkmod/cpu_reserve.c Fri Oct 18 19:32:04 2002 @@ -56,22 +56,8 @@ #include #ifdef CONFIG_MEASURE #include - -/* cdm */ -#include -/* /cdm/ */ - - #endif /* CONFIG_MEASURE */ -/* cdm */ -int gStatic_scaling_boost; - - -/* cdm */ -#define _DEBUG_CDM_ -/* /cdm/ */ - //#define EARLY_ENFORCE #define CHECK_TICKET_EXPIRE #define DELAY 5 @@ -88,11 +74,6 @@ /* * Function prototypes */ - -/* cdm */ -static void set_SPM_boost(void); -/* cdm\ */ - static int cpu_reserve_destroy(rk_reserve_t); static void cpu_reserve_start_account(rk_reserve_t); static void cpu_reserve_stop_account(rk_reserve_t, cpu_tick_t); @@ -154,13 +135,6 @@ cpu_reserve_wait_one_ticket, /* (wait_on_quota)if no tickets , sleep */ }; -/* - * Global variables - */ -struct list_head cpu_reserve_head; -cpu_capacity_t cpu_reserve_current_capacity; - - #define CAPACITY_INT(x) ((x)/100) #define CAPACITY_FRAC(x) ((x)-(x/100)*100) #define INT2CAPACITY(x) ((x)*10000) @@ -173,62 +147,16 @@ */ #define CPU_CAPACITY_MAX PERCENT2CAPACITY(66) -/* cdm */ -#define CPU_SPEED_BOOST_0 (300) -#define CPU_SPEED_BOOST_33 (400) -#define CPU_SPEED_BOOST_66 (500) -#define CPU_SPEED_BOOST_100 (600) -#define MAX_CPU_SPEED (CPU_SPEED_BOOST_100) - - - /* This function calculates our desired boost level, then iterates - ** through the entire list of processes and sets each processes boost - ** accordingly. - ** - ** It is called when a new cpu reserve is created, or when one is - ** modified via cpu_reserve_ctl. - */ -static void set_SPM_boost() -{ - struct task_struct *p; - int setBoostTo; - int percentMax; - int load; //percent of current capacity - - load = CAPACITY_INT( cpu_reserve_current_capacity ); - - - - /* First calculate the desired boost level */ - percentMax = load * MAX_CPU_SPEED; - percentMax = percentMax/100; - - /* Debugging code */ - printk("CDM: set_SPM_boost called with capacity %d, ideal clock %d\n", - load, - percentMax ); - - - if( percentMax < CPU_SPEED_BOOST_0 ) setBoostTo = 0; - else if( percentMax < CPU_SPEED_BOOST_33 ) setBoostTo = 33; - else if( percentMax < CPU_SPEED_BOOST_66 ) setBoostTo = 66; - else setBoostTo = 100; - - - - printk("CDM: setting global boost value to %d\n", setBoostTo ); - - /* loop through all our tasks and set the boost of each one */ - for_each_task(p) - { - p->boost = setBoostTo; - } -} - -/* \cdm\ */ - +/* + * + */ #define cpu_reserve_entry(list) list_entry((list), struct cpu_reserve, cpu_link) +/* + * Global variables + */ +struct list_head cpu_reserve_head; +cpu_capacity_t cpu_reserve_current_capacity; /* * More function prototypes @@ -282,7 +210,7 @@ #ifdef DEBUG_RK printk ("cpu_reserve_create: rs(0x%x) c(%d,%d) t(%d,%d) d(%d,%d) mode(%d,%d,%d)", - (int) rs, (int) cpu_attr->compute_time.tv_sec,http://rita.thegourmet.com/computers.html + (int) rs, (int) cpu_attr->compute_time.tv_sec, (int) cpu_attr->compute_time.tv_nsec, (int) cpu_attr->period.tv_sec, (int) cpu_attr->period.tv_nsec, (int) cpu_attr->deadline.tv_sec, (int) cpu_attr->deadline.tv_nsec, @@ -307,10 +235,7 @@ capacity = CAPACITY_OF(qc, qt); /* check for zero reservation */ -#if 0 /* This function calculates our desired boost level, then iterates - ** through the entire list of processes and sets each processes boost - ** accordingly - */ +#if 0 if (!timespec_nonzero(cpu_attr->compute_time)) { /* zero compute time: unacceptable value */ return NULL_RESERVE; @@ -398,7 +323,6 @@ /* init waitqueue */ // init_waitqueue(&cpu->depleted_wait); //Gaurav - init_waitqueue_head(&cpu->depleted_wait); /* check reservation type */ @@ -427,12 +351,6 @@ /* XXX: we must later have one timer per resource instance in set */ rk_replenish_timer_create(rsv, cpu_attr->start_time); - /* cdm */ - #ifdef _DEBUG_CDM_ - printk("CDM: Calling set_SPM_boost from create_cpu_reserve\n"); - #endif - set_SPM_boost(); - return rsv; /* success */ } @@ -530,7 +448,6 @@ (timespec_eq(old_local_attr.deadline, cpu_attr->deadline)) && (timespec_ge(old_local_attr.blocking_time, cpu_attr->blocking_time)) && - (timespec_ge(old_local_attr.compute_time, cpu_attr->compute_time))) { /* same period, same deadline, less compute time: must be ok */ @@ -556,7 +473,6 @@ break; } - if (adjust) { pos_adjust = TRUE; /* need this for possible resetting later */ priority_list_remove(cpu, &cpu_reserve_head); @@ -587,7 +503,6 @@ /* available utilization: is this really needed? */ new_capacity = capacity + cpu_reserve_current_capacity - - cpu->cpu_capacity; cpu_reserve_current_capacity = new_capacity; @@ -627,14 +542,7 @@ cpu->tickets.ticket_age = cpu->cpu_res_attr.ticket_age; } - /* CDM -- Look at the total utilization and set our boost */ - #ifdef _DEBUG_CDM_ - printk("Calling set_SPM_boost from cpu_reserve_ctl\n"); - #endif - set_SPM_boost(); - - - return RK_SUCCESS; /* success set_SPM_boost*/ + return RK_SUCCESS; /* success */ } static int cpu_reserve_destroy(rk_reserve_t rsv) @@ -665,10 +573,6 @@ rsv->rsv_rsv = NULL_RESERVE; rk_reserve_destroy(rsv); - -/* CDM */ - set_SPM_boost( ); - return RK_SUCCESS; /* success */ }