Linux: lock: preempt_disable; CONFIG_PREEMPT_COUNT;CONFIG_PREEMPT

定义

#define preempt_disable() barrier()
关于barrier,请参考:barrier:https://mzhan017.blog.csdn.net/article/details/124543474

看着代码里,这个功能已经失掉原有的含义。而且从时间上来看,已经没有用很久了。可以忽略 preempt_disable 这个代码。只需要记住只是代表一个barrier。

从Redhat提高的版本里看,这个没有设置preempt

config PREEMPT
bool “Preemptible Kernel (Low-Latency Desktop)”;可以抢占内核?
depends on !ARCH_NO_PREEMPT
select PREEMPTION
select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
帮助:这个配置,可以减小内核带来的延迟。是通过将内核代码(条件是:只要不是执行在关键区)可以被强占来实现这个低延时功能。This allows reaction to interactive events by permitting a low priority process to be preempted involuntari

猜你喜欢

转载自blog.csdn.net/qq_36428903/article/details/131869604