ia64/xen-unstable

changeset 4803:88008a5ffc2f

bitkeeper revision 1.1389.5.38 (427fa19dBMqmd2zGoBa8AA2fKxF9Ug)

SEDF merge fixes.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon May 09 17:45:01 2005 +0000 (2005-05-09)
parents 86285c9c18c1
children f470118a979e
files xen/common/sched_sedf.c xen/common/schedule.c
line diff
     1.1 --- a/xen/common/sched_sedf.c	Mon May 09 17:37:25 2005 +0000
     1.2 +++ b/xen/common/sched_sedf.c	Mon May 09 17:45:01 2005 +0000
     1.3 @@ -120,7 +120,7 @@ struct sedf_cpu_info {
     1.4  	struct list_head extraq[2];
     1.5  };
     1.6  
     1.7 -#define EDOM_INFO(d)		((struct sedf_edom_info *)((d)->ed_sched_priv))
     1.8 +#define EDOM_INFO(d)		((struct sedf_edom_info *)((d)->sched_priv))
     1.9  #define CPU_INFO(cpu)	((struct sedf_cpu_info *)schedule_data[cpu].sched_priv)
    1.10  #define LIST(d)			(&EDOM_INFO(d)->list)
    1.11  #define EXTRALIST(d,i)		(&(EDOM_INFO(d)->extralist[i]))
    1.12 @@ -163,7 +163,7 @@ static inline void extraq_del(struct exe
    1.13  	struct list_head *list = EXTRALIST(d,i);
    1.14  	ASSERT(extraq_on(d,i));
    1.15  	PRINT(3, "Removing domain %i.%i from L%i extraq\n", d->domain->id,
    1.16 -	   d->eid, i);	
    1.17 +	   d->id, i);	
    1.18  	list_del(list);
    1.19  	list->next = NULL;
    1.20  	ASSERT(!extraq_on(d, i));
    1.21 @@ -181,7 +181,7 @@ static inline void extraq_add_sort_updat
    1.22  	
    1.23  	ASSERT(!extraq_on(d,i));
    1.24  	PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %lli) to L%i "\
    1.25 -	         "extraq\n", d->domain->id, d->eid, EDOM_INFO(d)->score[i],
    1.26 +	         "extraq\n", d->domain->id, d->id, EDOM_INFO(d)->score[i],
    1.27  	         EDOM_INFO(d)->short_block_lost_tot, i);	
    1.28  	/*iterate through all elements to find our "hole" and on our way
    1.29  	  update all the other scores*/
    1.30 @@ -193,10 +193,10 @@ static inline void extraq_add_sort_updat
    1.31  		else
    1.32  			PRINT(4,"\tbehind domain %i.%i (score= %i)\n",
    1.33  			      curinf->exec_domain->domain->id,
    1.34 -			      curinf->exec_domain->eid, curinf->score[i]);
    1.35 +			      curinf->exec_domain->id, curinf->score[i]);
    1.36  	}
    1.37  	/*cur now contains the element, before which we'll enqueue*/
    1.38 -	PRINT(3, "\tlist_add to %x\n", cur->prev);
    1.39 +	PRINT(3, "\tlist_add to %p\n", cur->prev);
    1.40  	list_add(EXTRALIST(d,i),cur->prev);
    1.41  	
    1.42  	/*continue updating the extraq*/
    1.43 @@ -206,24 +206,24 @@ static inline void extraq_add_sort_updat
    1.44  			curinf = list_entry(cur,struct sedf_edom_info,
    1.45  				extralist[i]);
    1.46  			curinf->score[i] -= sub;
    1.47 -			PRINT(4, "\tupdating domain %i.%i (score= %llu)\n",
    1.48 +			PRINT(4, "\tupdating domain %i.%i (score= %u)\n",
    1.49  			      curinf->exec_domain->domain->id, 
    1.50 -			      curinf->exec_domain->eid, curinf->score[i]);
    1.51 +			      curinf->exec_domain->id, curinf->score[i]);
    1.52  		}
    1.53  	ASSERT(extraq_on(d,i));
    1.54  }
    1.55  static inline void extraq_check(struct exec_domain *d) {
    1.56  	if (extraq_on(d, EXTRA_UTIL_Q)) {
    1.57 -		PRINT(2,"Dom %i.%i is on L1 extraQ\n",d->domain->id, d->eid);
    1.58 +		PRINT(2,"Dom %i.%i is on L1 extraQ\n",d->domain->id, d->id);
    1.59  		if (!(EDOM_INFO(d)->status & EXTRA_AWARE) &&
    1.60  		    !extra_runs(EDOM_INFO(d))) {
    1.61  			extraq_del(d, EXTRA_UTIL_Q);
    1.62  			PRINT(2,"Removed dom %i.%i from L1 extraQ\n",
    1.63 -			      d->domain->id, d->eid);
    1.64 +			      d->domain->id, d->id);
    1.65  		}
    1.66  	} else {
    1.67  		PRINT(2,"Dom %i.%i is NOT on L1 extraQ\n",d->domain->id,
    1.68 -		      d->eid);
    1.69 +		      d->id);
    1.70  		if ((EDOM_INFO(d)->status & EXTRA_AWARE) && sedf_runnable(d))
    1.71  		{
    1.72  			#if (EXTRA == EXTRA_ROUNDR)
    1.73 @@ -235,7 +235,7 @@ static inline void extraq_check(struct e
    1.74  			;
    1.75  			#endif
    1.76  			PRINT(2,"Added dom %i.%i to L1 extraQ\n",d->domain->id,
    1.77 -			      d->eid);
    1.78 +			      d->id);
    1.79  		}
    1.80  	}
    1.81  }
    1.82 @@ -267,7 +267,7 @@ static inline void __del_from_queue(stru
    1.83      struct list_head *list = LIST(d);
    1.84      ASSERT(__task_on_queue(d));
    1.85      PRINT(3,"Removing domain %i.%i (bop= %llu) from runq/waitq\n", d->domain->id,
    1.86 -          d->eid, PERIOD_BEGIN(EDOM_INFO(d)));
    1.87 +          d->id, PERIOD_BEGIN(EDOM_INFO(d)));
    1.88      list_del(list);
    1.89      list->next = NULL;
    1.90      ASSERT(!__task_on_queue(d));
    1.91 @@ -284,7 +284,7 @@ static inline void list_insert_sort(stru
    1.92  	 		break;
    1.93  	}
    1.94  	/*cur now contains the element, before which we'll enqueue*/
    1.95 -	PRINT(3,"\tlist_add to %x\n",cur->prev);
    1.96 +	PRINT(3,"\tlist_add to %p\n",cur->prev);
    1.97  	list_add(element, cur->prev);
    1.98  }  
    1.99  #define DOMAIN_COMPARER(name, field, comp1, comp2)          \
   1.100 @@ -308,7 +308,7 @@ DOMAIN_COMPARER(waitq, list, PERIOD_BEGI
   1.101  static inline void __add_to_waitqueue_sort(struct exec_domain *d) {
   1.102  	ASSERT(!__task_on_queue(d));
   1.103  	PRINT(3,"Adding domain %i.%i (bop= %llu) to waitq\n", d->domain->id,
   1.104 -	      d->eid, PERIOD_BEGIN(EDOM_INFO(d)));
   1.105 +	      d->id, PERIOD_BEGIN(EDOM_INFO(d)));
   1.106  	list_insert_sort(WAITQ(d->processor), LIST(d), waitq_comp);
   1.107  	ASSERT(__task_on_queue(d));
   1.108  }
   1.109 @@ -321,7 +321,7 @@ static inline void __add_to_waitqueue_so
   1.110  DOMAIN_COMPARER(runq, list, d1->deadl_abs, d2->deadl_abs)
   1.111  static inline void __add_to_runqueue_sort(struct exec_domain *d) {
   1.112  	PRINT(3,"Adding domain %i.%i (deadl= %llu) to runq\n", d->domain->id,
   1.113 -	      d->eid, EDOM_INFO(d)->deadl_abs);
   1.114 +	      d->id, EDOM_INFO(d)->deadl_abs);
   1.115  	list_insert_sort(RUNQ(d->processor), LIST(d), runq_comp);
   1.116  }
   1.117  
   1.118 @@ -346,16 +346,16 @@ static int sedf_init_scheduler() {
   1.119  /* Allocates memory for per domain private scheduling data*/
   1.120  static int sedf_alloc_task(struct exec_domain *d) {
   1.121  	PRINT(2,"sedf_alloc_task was called, domain-id %i.%i\n",d->domain->id,
   1.122 -	      d->eid);
   1.123 +	      d->id);
   1.124  	if (d->domain->sched_priv == NULL) {
   1.125  		if ((d->domain->sched_priv = 
   1.126  		     xmalloc(struct sedf_dom_info)) == NULL )
   1.127  		return -1;
   1.128  		memset(d->domain->sched_priv, 0, sizeof(struct sedf_dom_info));
   1.129  	}
   1.130 -	if ((d->ed_sched_priv = xmalloc(struct sedf_edom_info)) == NULL )
   1.131 +	if ((d->sched_priv = xmalloc(struct sedf_edom_info)) == NULL )
   1.132  		return -1;
   1.133 -	memset(d->ed_sched_priv, 0, sizeof(struct sedf_edom_info));
   1.134 +	memset(d->sched_priv, 0, sizeof(struct sedf_edom_info));
   1.135  	return 0;
   1.136  }
   1.137  
   1.138 @@ -366,7 +366,7 @@ static void sedf_add_task(struct exec_do
   1.139  	inf->exec_domain = d;
   1.140  	
   1.141  	PRINT(2,"sedf_add_task was called, domain-id %i.%i\n",d->domain->id,
   1.142 -	      d->eid);
   1.143 +	      d->id);
   1.144  	      
   1.145  	if (d->domain->id==0) {
   1.146  		/*set dom0 to something useful to boot the machine*/
   1.147 @@ -405,22 +405,22 @@ static void sedf_free_task(struct domain
   1.148  	
   1.149  	for (i = 0; i < MAX_VIRT_CPUS; i++)
   1.150          	if ( d->exec_domain[i] ) {
   1.151 -			ASSERT(d->exec_domain[i]->ed_sched_priv != NULL);
   1.152 -			xfree(d->exec_domain[i]->ed_sched_priv);
   1.153 +			ASSERT(d->exec_domain[i]->sched_priv != NULL);
   1.154 +			xfree(d->exec_domain[i]->sched_priv);
   1.155  		}
   1.156  }
   1.157  
   1.158  /* Initialises idle task */
   1.159  static int sedf_init_idle_task(struct exec_domain *d) {
   1.160  	PRINT(2,"sedf_init_idle_task was called, domain-id %i.%i\n",
   1.161 -	      d->domain->id, d->eid);
   1.162 +	      d->domain->id, d->id);
   1.163  	if ( sedf_alloc_task(d) < 0 )
   1.164  		return -1;
   1.165  	
   1.166  	sedf_add_task(d);
   1.167  	EDOM_INFO(d)->deadl_abs = 0;
   1.168  	EDOM_INFO(d)->status &= ~SEDF_ASLEEP;
   1.169 -	set_bit(EDF_RUNNING, &d->ed_flags);
   1.170 +	set_bit(EDF_RUNNING, &d->flags);
   1.171  	/*the idle task doesn't have to turn up on any list...*/
   1.172  	return 0;
   1.173  }
   1.174 @@ -496,7 +496,7 @@ struct list_head* waitq) {
   1.175  	list_for_each_safe(cur, tmp, waitq) {
   1.176  		curinf = list_entry(cur, struct sedf_edom_info, list);
   1.177  		PRINT(4,"\tLooking @ dom %i.%i\n",
   1.178 -		      curinf->exec_domain->domain->id, curinf->exec_domain->eid);
   1.179 +		      curinf->exec_domain->domain->id, curinf->exec_domain->id);
   1.180  		if (PERIOD_BEGIN(curinf) <= now) {
   1.181  			__del_from_queue(curinf->exec_domain);
   1.182  			__add_to_runqueue_sort(curinf->exec_domain);
   1.183 @@ -511,12 +511,12 @@ struct list_head* waitq) {
   1.184  	list_for_each_safe(cur, tmp, runq) {
   1.185  		curinf = list_entry(cur,struct sedf_edom_info,list);
   1.186  		PRINT(4,"\tLooking @ dom %i.%i\n",
   1.187 -		      curinf->exec_domain->domain->id, curinf->exec_domain->eid);
   1.188 +		      curinf->exec_domain->domain->id, curinf->exec_domain->id);
   1.189  		if (unlikely(curinf->slice == 0)) {
   1.190  			/*ignore domains with empty slice*/
   1.191  			PRINT(4,"\tUpdating zero-slice domain %i.%i\n",
   1.192  			      curinf->exec_domain->domain->id,
   1.193 -			      curinf->exec_domain->eid);
   1.194 +			      curinf->exec_domain->id);
   1.195  			__del_from_queue(curinf->exec_domain);
   1.196  			
   1.197  			/*move them to their next period*/
   1.198 @@ -534,7 +534,7 @@ struct list_head* waitq) {
   1.199  				"slice (%llu / %llu) now: %llu "\
   1.200  				"cputime: %llu\n",
   1.201  				curinf->exec_domain->domain->id,
   1.202 -				curinf->exec_domain->eid,
   1.203 +				curinf->exec_domain->id,
   1.204  				curinf->deadl_abs, curinf->slice, now,
   1.205  				curinf->cputime);
   1.206  			__del_from_queue(curinf->exec_domain);
   1.207 @@ -600,11 +600,11 @@ static inline void desched_extra_dom(s_t
   1.208  		/*inf->short_block_lost_tot -= EXTRA_QUANTUM;*/
   1.209  		inf->short_block_lost_tot -= now - inf->sched_start_abs;
   1.210  		PRINT(3,"Domain %i.%i: Short_block_loss: %lli\n", 
   1.211 -		      inf->exec_domain->domain->id, inf->exec_domain->eid,
   1.212 +		      inf->exec_domain->domain->id, inf->exec_domain->id,
   1.213  		      inf->short_block_lost_tot);
   1.214  		if (inf->short_block_lost_tot <= 0) {
   1.215  			PRINT(4,"Domain %i.%i compensated short block loss!\n",
   1.216 -			  inf->exec_domain->domain->id, inf->exec_domain->eid);
   1.217 +			  inf->exec_domain->domain->id, inf->exec_domain->id);
   1.218  			/*we have (over-)compensated our block penalty*/
   1.219  			inf->short_block_lost_tot = 0;
   1.220  			/*we don't want a place on the penalty queue anymore!*/
   1.221 @@ -807,14 +807,14 @@ sched_done:
   1.222  }
   1.223  
   1.224  static void sedf_sleep(struct exec_domain *d) {
   1.225 -	PRINT(2,"sedf_sleep was called, domain-id %i.%i\n",d->domain->id, d->eid);
   1.226 +	PRINT(2,"sedf_sleep was called, domain-id %i.%i\n",d->domain->id, d->id);
   1.227  	
   1.228  	if (is_idle_task(d->domain))
   1.229  		return;
   1.230  
   1.231  	EDOM_INFO(d)->status |= SEDF_ASLEEP;
   1.232  	
   1.233 -	if ( test_bit(EDF_RUNNING, &d->ed_flags) ) {
   1.234 +	if ( test_bit(EDF_RUNNING, &d->flags) ) {
   1.235  #ifdef ADV_SCHED_HISTO
   1.236  		adv_sched_hist_start(d->processor);
   1.237  #endif
   1.238 @@ -1139,14 +1139,14 @@ void sedf_wake(struct exec_domain *d) {
   1.239  	s_time_t              now = NOW();
   1.240  	struct sedf_edom_info* inf = EDOM_INFO(d);
   1.241  	
   1.242 -	PRINT(3, "sedf_wake was called, domain-id %i.%i\n",d->domain->id, d->eid);
   1.243 +	PRINT(3, "sedf_wake was called, domain-id %i.%i\n",d->domain->id, d->id);
   1.244  	
   1.245  	if (unlikely(is_idle_task(d->domain)))
   1.246  		return;
   1.247  			
   1.248  	if ( unlikely(__task_on_queue(d)) ) {
   1.249  		PRINT(3,"\tdomain %i.%i is already in some queue\n",
   1.250 -		      d->domain->id, d->eid);
   1.251 +		      d->domain->id, d->id);
   1.252  		return;
   1.253  	}
   1.254  	ASSERT(!sedf_runnable(d));
   1.255 @@ -1159,7 +1159,7 @@ void sedf_wake(struct exec_domain *d) {
   1.256  		inf->deadl_abs = now + inf->slice;
   1.257  		
   1.258  	PRINT(3,"waking up domain %i.%i (deadl= %llu period= %llu "\
   1.259 -	        "now= %llu)\n", d->domain->id, d->eid, inf->deadl_abs,
   1.260 +	        "now= %llu)\n", d->domain->id, d->id, inf->deadl_abs,
   1.261  		 inf->period, now);
   1.262  #ifdef SEDF_STATS	
   1.263  	inf->block_tot++;
   1.264 @@ -1221,7 +1221,7 @@ void sedf_wake(struct exec_domain *d) {
   1.265  		}
   1.266  	}
   1.267  	PRINT(3,"woke up domain %i.%i (deadl= %llu period= %llu "\
   1.268 -	        "now= %llu)\n", d->domain->id, d->eid, inf->deadl_abs,
   1.269 +	        "now= %llu)\n", d->domain->id, d->id, inf->deadl_abs,
   1.270  		inf->period, now);
   1.271  	if (PERIOD_BEGIN(inf) > now) {
   1.272  		__add_to_waitqueue_sort(d);
   1.273 @@ -1256,23 +1256,23 @@ void sedf_wake(struct exec_domain *d) {
   1.274  
   1.275  /*Print a lot of use-{full, less} information about a domains in the system*/
   1.276  static void sedf_dump_domain(struct exec_domain *d) {
   1.277 -	printk("%i.%i has=%c ", d->domain->id, d->eid,
   1.278 -		test_bit(EDF_RUNNING, &d->ed_flags) ? 'T':'F');
   1.279 +	printk("%i.%i has=%c ", d->domain->id, d->id,
   1.280 +		test_bit(EDF_RUNNING, &d->flags) ? 'T':'F');
   1.281  	printk("p=%llu sl=%llu ddl=%llu w=%hu c=%llu sc=%i xtr(%s)=%llu ew=%hu",
   1.282  	  EDOM_INFO(d)->period, EDOM_INFO(d)->slice, EDOM_INFO(d)->deadl_abs,
   1.283  	  EDOM_INFO(d)->weight, d->cpu_time, EDOM_INFO(d)->score[EXTRA_UTIL_Q],
   1.284  	 (EDOM_INFO(d)->status & EXTRA_AWARE) ? "yes" : "no",
   1.285  	  EDOM_INFO(d)->extra_time_tot, EDOM_INFO(d)->extraweight);
   1.286  	if (d->cpu_time !=0)
   1.287 -		printf(" (%lu%)", (EDOM_INFO(d)->extra_time_tot * 100)
   1.288 +		printf(" (%llu%%)", (EDOM_INFO(d)->extra_time_tot * 100)
   1.289  		                 / d->cpu_time);
   1.290  #ifdef SEDF_STATS
   1.291  	if (EDOM_INFO(d)->block_time_tot!=0)
   1.292 -		printf(" pen=%lu%", (EDOM_INFO(d)->penalty_time_tot * 100) /
   1.293 +		printf(" pen=%llu%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
   1.294  		                     EDOM_INFO(d)->block_time_tot);
   1.295  	if (EDOM_INFO(d)->block_tot!=0)
   1.296 -		printf("\n   blks=%lu sh=%lu (%lu%) (shc=%lu (%lu%) shex=%i "\
   1.297 -		       "shexsl=%i) l=%lu (%lu%) avg: b=%llu p=%llu",
   1.298 +		printf("\n   blks=%u sh=%u (%u%%) (shc=%u (%u%%) shex=%i "\
   1.299 +		       "shexsl=%i) l=%u (%u%%) avg: b=%llu p=%llu",
   1.300  		    EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_block_tot,
   1.301  		   (EDOM_INFO(d)->short_block_tot * 100) 
   1.302  		  / EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_cont,
     2.1 --- a/xen/common/schedule.c	Mon May 09 17:37:25 2005 +0000
     2.2 +++ b/xen/common/schedule.c	Mon May 09 17:45:01 2005 +0000
     2.3 @@ -297,7 +297,6 @@ long do_sched_op(unsigned long op)
     2.4      case SCHEDOP_shutdown:
     2.5      {
     2.6          TRACE_3D(TRC_SCHED_SHUTDOWN, current->domain->id, current->id,
     2.7 -        TRACE_3D(TRC_SCHED_SHUTDOWN, current->domain->id, current->id,
     2.8                   (op >> SCHEDOP_reasonshift));
     2.9          domain_shutdown((u8)(op >> SCHEDOP_reasonshift));
    2.10          break;