ia64/xen-unstable

changeset 2050:7831e606f604

bitkeeper revision 1.1108.55.1 (410f7325EUY_TUkJ10hye8yd_iKlbQ)

Lock renaming
author gm281@boulderdash.cl.cam.ac.uk
date Tue Aug 03 11:12:37 2004 +0000 (2004-08-03)
parents 4ab908608402
children 257201a98550
files xen/common/domain.c xen/common/sched_bvt.c xen/common/sched_fair_bvt.c xen/common/sched_rrobin.c xen/common/schedule.c xen/include/xen/sched.h
line diff
     1.1 --- a/xen/common/domain.c	Tue Aug 03 10:55:54 2004 +0000
     1.2 +++ b/xen/common/domain.c	Tue Aug 03 11:12:37 2004 +0000
     1.3 @@ -39,8 +39,8 @@ struct domain *do_createdomain(domid_t d
     1.4      d->domain    = dom_id;
     1.5      d->processor = cpu;
     1.6      d->create_time = NOW();
     1.7 -    /* Initialise the state_lock */
     1.8 -    spin_lock_init(&d->state_lock);
     1.9 +    /* Initialise the sleep_lock */
    1.10 +    spin_lock_init(&d->sleep_lock);
    1.11   
    1.12      memcpy(&d->thread, &idle0_task.thread, sizeof(d->thread));
    1.13  
     2.1 --- a/xen/common/sched_bvt.c	Tue Aug 03 10:55:54 2004 +0000
     2.2 +++ b/xen/common/sched_bvt.c	Tue Aug 03 11:12:37 2004 +0000
     2.3 @@ -230,13 +230,12 @@ void bvt_wake(struct domain *d)
     2.4               ((inf->evt - curr_evt) / BVT_INFO(curr)->mcu_advance) +
     2.5               ctx_allow;
     2.6  
     2.7 -
     2.8 -    spin_unlock_irqrestore(&schedule_data[cpu].schedule_lock, flags);   
     2.9      if ( is_idle_task(curr) || (inf->evt <= curr_evt) )
    2.10          cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ);
    2.11      else if ( schedule_data[cpu].s_timer.expires > r_time )
    2.12          mod_ac_timer(&schedule_data[cpu].s_timer, r_time);
    2.13  
    2.14 +    spin_unlock_irqrestore(&schedule_data[cpu].schedule_lock, flags);  
    2.15  }
    2.16  
    2.17  
     3.1 --- a/xen/common/sched_fair_bvt.c	Tue Aug 03 10:55:54 2004 +0000
     3.2 +++ b/xen/common/sched_fair_bvt.c	Tue Aug 03 11:12:37 2004 +0000
     3.3 @@ -276,12 +276,12 @@ static void fbvt_wake(struct domain *d)
     3.4      /* Currently-running domain should run at least for ctx_allow. */
     3.5      min_time = curr->lastschd + ctx_allow;
     3.6      
     3.7 -    spin_unlock_irqrestore(&schedule_data[cpu].schedule_lock, flags);   
     3.8 -    
     3.9      if ( is_idle_task(curr) || (min_time <= now) )
    3.10          cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ);
    3.11      else if ( schedule_data[cpu].s_timer.expires > (min_time + TIME_SLOP) )
    3.12          mod_ac_timer(&schedule_data[cpu].s_timer, min_time);
    3.13 +
    3.14 +    spin_unlock_irqrestore(&schedule_data[cpu].schedule_lock, flags);   
    3.15  }
    3.16  
    3.17  
     4.1 --- a/xen/common/sched_rrobin.c	Tue Aug 03 10:55:54 2004 +0000
     4.2 +++ b/xen/common/sched_rrobin.c	Tue Aug 03 11:12:37 2004 +0000
     4.3 @@ -218,10 +218,11 @@ void rr_wake(struct domain *d)
     4.4  
     4.5      spin_lock_irqsave(&schedule_data[cpu].schedule_lock, flags);
     4.6      curr = schedule_data[cpu].curr;
     4.7 -    spin_unlock_irqrestore(&schedule_data[cpu].schedule_lock, flags);
     4.8   
     4.9      if ( is_idle_task(curr) )
    4.10          cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ);
    4.11 +
    4.12 +    spin_unlock_irqrestore(&schedule_data[cpu].schedule_lock, flags);
    4.13  }
    4.14  
    4.15  
     5.1 --- a/xen/common/schedule.c	Tue Aug 03 10:55:54 2004 +0000
     5.2 +++ b/xen/common/schedule.c	Tue Aug 03 11:12:37 2004 +0000
     5.3 @@ -165,11 +165,11 @@ void domain_sleep(struct domain *d)
     5.4  {
     5.5      unsigned long flags;
     5.6  
     5.7 -    /* sleep and wake protected by domain's state_lock */
     5.8 -    spin_lock_irqsave(&d->state_lock, flags);
     5.9 +    /* sleep and wake protected by domain's sleep_lock */
    5.10 +    spin_lock_irqsave(&d->sleep_lock, flags);
    5.11      if ( likely(!domain_runnable(d)) )
    5.12          SCHED_OP(sleep, d);
    5.13 -    spin_unlock_irqrestore(&d->state_lock, flags);
    5.14 +    spin_unlock_irqrestore(&d->sleep_lock, flags);
    5.15   
    5.16      /* Synchronous. */
    5.17      while ( test_bit(DF_RUNNING, &d->flags) && !domain_runnable(d) )
    5.18 @@ -183,7 +183,7 @@ void domain_wake(struct domain *d)
    5.19  {
    5.20      unsigned long       flags;
    5.21  
    5.22 -    spin_lock_irqsave(&d->state_lock, flags);
    5.23 +    spin_lock_irqsave(&d->sleep_lock, flags);
    5.24      
    5.25      if ( likely(domain_runnable(d)) )
    5.26      {
    5.27 @@ -196,7 +196,7 @@ void domain_wake(struct domain *d)
    5.28      
    5.29      clear_bit(DF_MIGRATED, &d->flags);
    5.30      
    5.31 -    spin_unlock_irqrestore(&d->state_lock, flags);
    5.32 +    spin_unlock_irqrestore(&d->sleep_lock, flags);
    5.33  }
    5.34  
    5.35  /* Block the currently-executing domain until a pertinent event occurs. */
     6.1 --- a/xen/include/xen/sched.h	Tue Aug 03 10:55:54 2004 +0000
     6.2 +++ b/xen/include/xen/sched.h	Tue Aug 03 11:12:37 2004 +0000
     6.3 @@ -101,7 +101,7 @@ struct domain
     6.4  
     6.5      /* Scheduling. */
     6.6      int              shutdown_code; /* code value from OS (if DF_SHUTDOWN). */
     6.7 -    spinlock_t       state_lock;    /* wake/sleep lock                      */
     6.8 +    spinlock_t       sleep_lock;    /* wake/sleep lock                      */
     6.9      s_time_t         lastschd;      /* time this domain was last scheduled */
    6.10      s_time_t         lastdeschd;    /* time this domain was last descheduled */
    6.11      s_time_t         cpu_time;      /* total CPU time received till now */