加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

在linux内核中使用stop_sched_class有什么用处

发布时间:2020-12-13 22:54:20 所属栏目:Linux 来源:网络整理
导读:在内核中使用stop_sched_class有什么用?在pick_next_task函数中,调度程序将首先从stop_sched_class中选择下一个任务.有没有问题我为内核删除了这个sched_class? #define for_each_class(class) for (class = sched_class_highest; class; class = class-
在内核中使用stop_sched_class有什么用?在pick_next_task函数中,调度程序将首先从stop_sched_class中选择下一个任务.有没有问题我为内核删除了这个sched_class?

#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,};

解决方法

stop_sched_class用于停止cpu,在SMP系统上使用,用于负载均衡和cpu hotplug.此类具有最高的调度优先级.

如果您的系统没有定义CONFIG_SMP,您可以尝试删除此类,需要更改几个文件才能成功编译.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读