 schedule ()

          
       schedule ().  
         (sleep), a
    -  .  schedule () -
   . ,   -
    ,    .

 schedule ()  ,    , -
  .        -
.

struct task_struct *prev, *next;

struct list head *queue;

struct prio_array *array;

int idx;

prev = current;

array = rq->active;

idx = sched_find_first_bit (array-bitmap) ;

queue = array->queue + idx;

next = list_entry(queue->next, struct task_struct, run_list) ;

        
      .   -
       .  
     ,    -
 .          -
,        .  
   . 4.2.

sched_find_first_set()

 7  7

  
  
 
  

 139  139  /'"

     

 
  ,
  7

. 4.2.  , 0(1)-   

   77