Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of stop_sched_class in linux kernel

What is the use of stop_sched_class in Kernel? In pick_next_task function, the scheduler will pick the next task from stop_sched_class first. Is there any problem I delete this sched_class for Kernel ?

#define for_each_class(class) \
   for (class = sched_class_highest; class; class = class->next)


#define sched_class_highest (&stop_sched_class)
extern const struct sched_class stop_sched_class;

/*
 * Simple, special scheduling class for the per-CPU stop tasks:
*/
const struct sched_class stop_sched_class = {
   .next                   = &rt_sched_class,

   .enqueue_task           = enqueue_task_stop,
   .dequeue_task           = dequeue_task_stop,
   .yield_task             = yield_task_stop,

   .check_preempt_curr     = check_preempt_curr_stop,

   .pick_next_task         = pick_next_task_stop,
   .put_prev_task          = put_prev_task_stop,

 #ifdef CONFIG_SMP
   .select_task_rq         = select_task_rq_stop,
 #endif

  .set_curr_task          = set_curr_task_stop,
  .task_tick              = task_tick_stop,

  .get_rr_interval        = get_rr_interval_stop,

  .prio_changed           = prio_changed_stop,
  .switched_to            = switched_to_stop,
};
like image 771
goodjesse Avatar asked Mar 14 '13 01:03

goodjesse


1 Answers

The stop_sched_class is to stop cpu, using on SMP system, for load balancing and cpu hotplug. This class have the highest scheduling priority.

If your system does not define CONFIG_SMP, you can try to remove this class, there are several files need to be changed for successful compilation.

like image 152
tian_yufeng Avatar answered Nov 07 '22 14:11

tian_yufeng