ia64/xen-unstable

changeset 786:d666e315c859

bitkeeper revision 1.479 (3f813947vLCvbxYLugd4rI8gd1R05Q)

sched.h, softirq.c, schedule.c, event.c, domain.c, process.c:
Cleanups to new scheduler world.
author kaf24@scramble.cl.cam.ac.uk
date Mon Oct 06 09:43:35 2003 +0000 (2003-10-06)
parents b45bc774c22c
children 3e6f62b7d409 9c21e28c40a0
files xen/arch/i386/process.c xen/common/domain.c xen/common/event.c xen/common/schedule.c xen/common/softirq.c xen/include/xeno/sched.h
line diff
     1.1 --- a/xen/arch/i386/process.c	Fri Oct 03 16:36:21 2003 +0000
     1.2 +++ b/xen/arch/i386/process.c	Mon Oct 06 09:43:35 2003 +0000
     1.3 @@ -76,7 +76,7 @@ void startup_cpu_idle_loop(void)
     1.4      /* Just some sanity to ensure that the scheduler is set up okay. */
     1.5      ASSERT(current->domain == IDLE_DOMAIN_ID);
     1.6      (void)wake_up(current);
     1.7 -    schedule();
     1.8 +    __enter_scheduler();
     1.9  
    1.10      /*
    1.11       * Declares CPU setup done to the boot processor.
     2.1 --- a/xen/common/domain.c	Fri Oct 03 16:36:21 2003 +0000
     2.2 +++ b/xen/common/domain.c	Mon Oct 06 09:43:35 2003 +0000
     2.3 @@ -151,7 +151,7 @@ void __kill_domain(struct task_struct *p
     2.4  
     2.5      if ( p == current )
     2.6      {
     2.7 -        schedule();
     2.8 +        __enter_scheduler();
     2.9          BUG(); /* never get here */
    2.10      }
    2.11      else
    2.12 @@ -196,9 +196,9 @@ long kill_other_domain(unsigned int dom,
    2.13  
    2.14  void stop_domain(void)
    2.15  {
    2.16 -    current -> state = TASK_SUSPENDED;
    2.17 -    clear_bit(_HYP_EVENT_STOP, &(current->hyp_events));
    2.18 -    schedule ();
    2.19 +    set_current_state(TASK_SUSPENDED);
    2.20 +    clear_bit(_HYP_EVENT_STOP, &current->hyp_events);
    2.21 +    __enter_scheduler();
    2.22  }
    2.23  
    2.24  long stop_other_domain(unsigned int dom)
     3.1 --- a/xen/common/event.c	Fri Oct 03 16:36:21 2003 +0000
     3.2 +++ b/xen/common/event.c	Mon Oct 06 09:43:35 2003 +0000
     3.3 @@ -13,12 +13,10 @@
     3.4  
     3.5  typedef void (*hyp_event_callback_fn_t)(void);
     3.6  
     3.7 -extern void schedule(void);
     3.8 -
     3.9  /* Ordering must match definitions of _HYP_EVENT_* in xeno/sched.h */
    3.10  static hyp_event_callback_fn_t event_call_fn[] = 
    3.11  {
    3.12 -    schedule,
    3.13 +    __enter_scheduler,
    3.14      kill_domain,
    3.15      stop_domain
    3.16  };
     4.1 --- a/xen/common/schedule.c	Fri Oct 03 16:36:21 2003 +0000
     4.2 +++ b/xen/common/schedule.c	Mon Oct 06 09:43:35 2003 +0000
     4.3 @@ -201,7 +201,7 @@ long do_yield(void)
     4.4  {
     4.5      current->state = TASK_INTERRUPTIBLE;
     4.6      current->warpback = 0; /* XXX should only do this when blocking */
     4.7 -    schedule();
     4.8 +    __enter_scheduler();
     4.9      return 0;
    4.10  }
    4.11  
    4.12 @@ -293,7 +293,7 @@ void reschedule(struct task_struct *p)
    4.13   *   i.e., the domain with lowest EVT.
    4.14   *   The runqueue should be ordered by EVT so that is easy.
    4.15   ****************************************************************************/
    4.16 -asmlinkage void schedule(void)
    4.17 +asmlinkage void __enter_scheduler(void)
    4.18  {
    4.19      struct task_struct *prev, *next, *next_prime, *p;
    4.20      struct list_head   *tmp;
     5.1 --- a/xen/common/softirq.c	Fri Oct 03 16:36:21 2003 +0000
     5.2 +++ b/xen/common/softirq.c	Mon Oct 06 09:43:35 2003 +0000
     5.3 @@ -225,14 +225,9 @@ void tasklet_kill(struct tasklet_struct 
     5.4  {
     5.5      if (in_interrupt())
     5.6          printk("Attempt to kill tasklet from interrupt\n");
     5.7 -
     5.8 -    while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
     5.9 -        set_current_state(TASK_RUNNING);
    5.10 -        do {
    5.11 -            current->policy |= SCHED_YIELD;
    5.12 -            schedule();
    5.13 -        } while (test_bit(TASKLET_STATE_SCHED, &t->state));
    5.14 -    }
    5.15 +    while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
    5.16 +        while (test_bit(TASKLET_STATE_SCHED, &t->state))
    5.17 +            do_softirq();
    5.18      tasklet_unlock_wait(t);
    5.19      clear_bit(TASKLET_STATE_SCHED, &t->state);
    5.20  }
     6.1 --- a/xen/include/xeno/sched.h	Fri Oct 03 16:36:21 2003 +0000
     6.2 +++ b/xen/include/xeno/sched.h	Mon Oct 06 09:43:35 2003 +0000
     6.3 @@ -276,7 +276,10 @@ void init_idle_task(void);
     6.4  int  wake_up(struct task_struct *p);
     6.5  long do_yield(void);
     6.6  void reschedule(struct task_struct *p);
     6.7 -asmlinkage void schedule(void);
     6.8 +
     6.9 +/* NB. Limited entry in Xen. Not for arbitrary use! */
    6.10 +asmlinkage void __enter_scheduler(void);
    6.11 +#define schedule() __schedule_not_callable_in_xen()
    6.12  
    6.13  /* A compatibility hack for Linux drivers. */
    6.14  #define MAX_SCHEDULE_TIMEOUT 0UL