ia64/xen-unstable

changeset 1722:21d790dad6e6

bitkeeper revision 1.1054 (40ed8e097hqWQ3yDtTM5H6XnNbggVQ)

Minor changes to make xen compile when debugging is switched on.
author gm281@boulderdash.cl.cam.ac.uk
date Thu Jul 08 18:10:17 2004 +0000 (2004-07-08)
parents 3b98f6df869f
children e04e40b4615f
files xen/common/debug.c xen/common/domain.c xen/common/sched_fair_bvt.c xen/common/schedule.c
line diff
     1.1 --- a/xen/common/debug.c	Thu Jul 08 12:49:34 2004 +0000
     1.2 +++ b/xen/common/debug.c	Thu Jul 08 18:10:17 2004 +0000
     1.3 @@ -12,6 +12,7 @@
     1.4  #include <xen/event.h>
     1.5  #include <asm/page.h>
     1.6  #include <asm/pdb.h>
     1.7 +#include <asm/shadow.h>
     1.8  
     1.9  #undef DEBUG_TRACE
    1.10  #ifdef DEBUG_TRACE
     2.1 --- a/xen/common/domain.c	Thu Jul 08 12:49:34 2004 +0000
     2.2 +++ b/xen/common/domain.c	Thu Jul 08 18:10:17 2004 +0000
     2.3 @@ -11,6 +11,8 @@
     2.4  #include <xen/shadow.h>
     2.5  #include <xen/elf.h>
     2.6  #include <hypervisor-ifs/dom0_ops.h>
     2.7 +#include <asm/hardirq.h>
     2.8 +#include <asm/domain_page.h>
     2.9  
    2.10  /* Both these structures are protected by the tasklist_lock. */
    2.11  rwlock_t tasklist_lock __cacheline_aligned = RW_LOCK_UNLOCKED;
     3.1 --- a/xen/common/sched_fair_bvt.c	Thu Jul 08 12:49:34 2004 +0000
     3.2 +++ b/xen/common/sched_fair_bvt.c	Thu Jul 08 18:10:17 2004 +0000
     3.3 @@ -1,19 +1,20 @@
     3.4  /* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
     3.5   ****************************************************************************
     3.6 - * (C) 2002-2003 - Rolf Neugebauer - Intel Research Cambridge
     3.7 - * (C) 2002-2003 University of Cambridge
     3.8 - * (C) 2004      - Mark Williamson - Intel Research Cambridge
     3.9 + * (C) 2004      Grzegorz Milos - University of Cambridge
    3.10 + * Based on the implementation of the BVT scheduler by Rolf Neugebauer
    3.11 + * and Mark Williamson (look in sched_bvt.c)
    3.12   ****************************************************************************
    3.13   *
    3.14 - *        File: common/schedule.c
    3.15 - *      Author: Rolf Neugebauer & Keir Fraser
    3.16 - *              Updated for generic API by Mark Williamson
    3.17 + *        File: common/sched_fair_bvt.c
    3.18 + *      Author: Grzegorz Milos
    3.19   *
    3.20   * Description: CPU scheduling
    3.21 - *              implements A Borrowed Virtual Time scheduler.
    3.22 - *              (see Duda & Cheriton SOSP'99)
    3.23 + *              implements Fair Borrowed Virtual Time Scheduler.
    3.24 + *              FBVT is modification of BVT (see Duda & Cheriton SOSP'99)
    3.25 + *              which tries to allocate fair shares of processor even 
    3.26 + *              when there is mix between CPU and I/O bound domains.
    3.27 + *              TODO - more information about the scheduler in TODO
    3.28   */
    3.29 -
    3.30  #include <xen/config.h>
    3.31  #include <xen/init.h>
    3.32  #include <xen/lib.h>
    3.33 @@ -25,6 +26,10 @@
    3.34  #include <xen/perfc.h>
    3.35  #include <xen/sched-if.h>
    3.36  #include <xen/slab.h>
    3.37 +#include <xen/trace.h>
    3.38 +
    3.39 +/* For tracing - TODO - put all the defines in some common hearder file */
    3.40 +#define TRC_SCHED_FBVT_DO_SCHED             0x00020000
    3.41  
    3.42  
    3.43  /* all per-domain BVT-specific scheduling info is stored here */
    3.44 @@ -171,7 +176,7 @@ void fbvt_wake_up(struct domain *p)
    3.45  	 	 */
    3.46  	
    3.47  		io_warp = (int)(0.5 * inf->time_slept);
    3.48 -		if(io_warp > 10000) io_warp = 10000;
    3.49 +		if(io_warp > 1000) io_warp = 1000;
    3.50  
    3.51  		ASSERT(inf->time_slept + CPU_SVT(p->processor) > inf->avt + io_warp);
    3.52  		inf->time_slept += CPU_SVT(p->processor) - inf->avt - io_warp;
    3.53 @@ -429,13 +434,16 @@ static task_slice_t fbvt_do_schedule(s_t
    3.54     
    3.55      r_time = ((next_prime_inf->evt + next_inf->vtb - next_inf->evt)/next_inf->mcu_advance)
    3.56          + ctx_allow;
    3.57 -
    3.58 +        
    3.59      ASSERT(r_time >= ctx_allow);
    3.60  
    3.61   sched_done:
    3.62 + 
    3.63 +    TRACE_2D(TRC_SCHED_FBVT_DO_SCHED, next->domain, r_time);
    3.64      next->min_slice = ctx_allow;
    3.65      ret.task = next;
    3.66      ret.time = r_time;
    3.67 + 
    3.68      return ret;
    3.69  }
    3.70  
     4.1 --- a/xen/common/schedule.c	Thu Jul 08 12:49:34 2004 +0000
     4.2 +++ b/xen/common/schedule.c	Thu Jul 08 18:10:17 2004 +0000
     4.3 @@ -381,7 +381,6 @@ void __enter_scheduler(void)
     4.4      rem_ac_timer(&schedule_data[cpu].s_timer);
     4.5      
     4.6      ASSERT(!in_irq());
     4.7 -if(!__task_on_runqueue(prev)) printk("Domain %d not on runqueue\n",prev->domain);
     4.8      ASSERT(__task_on_runqueue(prev));
     4.9  
    4.10      if ( test_bit(DF_BLOCKED, &prev->flags) )