在 linux 内核调度程序中抑制一个进程(不杀死)
Suppress a process in linux kernel scheduler (not kill)
在linux调度器中,我想通过修改调度器代码来抑制一些进程。是否可以不杀进程只压制压制进程?
In the linux scheduler, I want to suppress some processes by modifying the scheduler code
可能不可能,而且肯定是定义错误。想到修改内核的好方法是首先:不要,后来还没有,最后尽可能地小心!
"suppressing"一个过程对您来说究竟意味着什么?您可能想要 终止 它。您当然不能 简单地 "suppress" 某些进程,因为内核在终止后正在仔细清理。
你为什么要修改内核?一般来说,user-space and user-mode is a better place to do such things (or even systemd). You might want to also have some kernel thread(非常棘手)。
您可能会考虑内核到用户的 space 与 netlink(7), then try to minimize your kernel footprint. Be however aware that the scheduler 的通信是内核中的一段关键且经过很好调整的代码。
实际上,我建议使用高优先级 用户态守护进程。参见 setpriority(2), nice(2) and sched(7). We don't know what you want to achieve, but it is likely do be practically doable in user-land. And if it is not, perhaps Linux is not the right kernel for you (taking into account that you Silvara is a drone developer). Then look into genuine real-time operating systems, IoT OSes like Contiki, or library operating systems unikernels such as MirageOS。
在linux调度器中,我想通过修改调度器代码来抑制一些进程。是否可以不杀进程只压制压制进程?
In the linux scheduler, I want to suppress some processes by modifying the scheduler code
可能不可能,而且肯定是定义错误。想到修改内核的好方法是首先:不要,后来还没有,最后尽可能地小心!
"suppressing"一个过程对您来说究竟意味着什么?您可能想要 终止 它。您当然不能 简单地 "suppress" 某些进程,因为内核在终止后正在仔细清理。
你为什么要修改内核?一般来说,user-space and user-mode is a better place to do such things (or even systemd). You might want to also have some kernel thread(非常棘手)。
您可能会考虑内核到用户的 space 与 netlink(7), then try to minimize your kernel footprint. Be however aware that the scheduler 的通信是内核中的一段关键且经过很好调整的代码。
实际上,我建议使用高优先级 用户态守护进程。参见 setpriority(2), nice(2) and sched(7). We don't know what you want to achieve, but it is likely do be practically doable in user-land. And if it is not, perhaps Linux is not the right kernel for you (taking into account that you Silvara is a drone developer). Then look into genuine real-time operating systems, IoT OSes like Contiki, or library operating systems unikernels such as MirageOS。