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

内核模式下的Linux进程调度

发布时间:2020-12-14 01:06:53 所属栏目:Linux 来源:网络整理
导读:以下是Wiki引用的一些描述 The Linux kernel provides preemptive scheduling under certain conditions. Until kernel version 2.4,only processes were preemptive, i.e. in addition to time quantum expiration,an execution of current process in user
以下是Wiki引用的一些描述

The Linux kernel provides preemptive scheduling under certain
conditions. Until kernel version 2.4,only processes were preemptive,
i.e. in addition to time quantum expiration,an execution of current
process in user mode would be interrupted if higher dynamic priority
processes entered TASK_RUNNING state. Towards Linux 2.6,an
ability to interrupt a task executing kernel code was added,although
with that not all sections of the kernel code can be preempted.

然后它也说这个,

Preemption improves latency,increases responsiveness,and makes Linux
more suitable for desktop and real-time applications. Older versions
of the kernel had a so-called big kernel lock for synchronization
across the entire kernel. This was finally removed by Arnd Bergmann in
2011

那么上面的语句对于内核抢占的当前Linux内核是否适用
条件?例如如果通过进行系统调用将进程陷入内核模式,则此进程不会处于抢占式调度之下?

在哪里可以找到有关用户模式和内核模式下linux调度的最新介绍文章/书籍?

解决方法

CPU调度决策可能在进程时发生:

1. Switches from running to waiting state (e.g. I/O request)
2. Switches from running to ready state (e.g. Interrupt)
3. Switches from waiting to ready (e.g. I/O completion)
4. Terminates

1和4下的调度是非抢占式的,所有其他调度都是抢占式的,必须处理操作(系统调用)可能不完整的可能性.

是Linux在某些条件下提供抢占式调度,不像某些Unix变种,其中内核调度直到完成而没有抢占.在Linux 2.6中,只要没有锁定并且安全地重新安排,内核就会被抢先一个任务运行.

Older versions of the kernel had a so-called big kernel lock for synchronization 
across the entire kernel.

指每个用户级线程仅映射到一个内核线程.

(编辑:李大同)

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

    推荐文章
      热点阅读