国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

CONFIG_PREEMPT 和 CONFIG_PREEMPT_VOLUNTARY的區別

2019-11-08 00:15:11
字體:
來源:轉載
供稿:網友
在kernel/kernel/Kconfig.PReempt中定義了兩種搶占策略,PREEMPT_VOLUNTARY和PREEMPT其中PREEMPT_VOLUNTARY 適用于有桌面的環境,而PREEMPT 則可以用于桌面或者嵌入式,其調度延遲是毫秒級別的。詳細說明如下:config PREEMPT_VOLUNTARY    bool "Voluntary Kernel Preemption (Desktop)"    help      This option reduces the latency of the kernel by adding more      "explicit preemption points" to the kernel code. These new      preemption points have been selected to reduce the maximum      latency of rescheduling, providing faster application reactions,      at the cost of slightly lower throughput.      This allows reaction to interactive events by allowing a      low priority process to voluntarily preempt itself even if it      is in kernel mode executing a system call. This allows      applications to run more 'smoothly' even when the system is      under load.      Select this if you are building a kernel for a desktop system.config PREEMPT    bool "Preemptible Kernel (Low-Latency Desktop)"    select PREEMPT_COUNT    select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK    help      This option reduces the latency of the kernel by making      all kernel code (that is not executing in a critical section)      preemptible.  This allows reaction to interactive events by      permitting a low priority process to be preempted involuntarily      even if it is in kernel mode executing a system call and would      otherwise not be about to reach a natural preemption point.      This allows applications to run more 'smoothly' even when the      system is under load, at the cost of slightly lower throughput      and a slight runtime overhead to kernel code.      Select this if you are building a kernel for a desktop or      embedded system with latency requirements in the milliseconds從code中看主要影響下面這兩個函數static inline void crypto_yield(u32 flags){#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PREEMPT_VOLUNTARY)    if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)        cond_resched();#endif}在crypto_yield 中如果定義了CONFIG_PREEMPT_VOLUNTARY 就調度,而CONFIG_PREEMPT 則是不調度的,繼續留在原來的task中和#ifdef CONFIG_PREEMPT_VOLUNTARYextern int _cond_resched(void);# define might_resched() _cond_resched()#else# define might_resched() do { } while (0)#endif如果code中調用might_resched的話,就發生調度。從code中看CONFIG_PREEMPT_VOLUNTARY 就是會比 CONFIG_PREEMPT 的調度延遲少一點。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 巴马| 五河县| 闻喜县| 普定县| 南木林县| 青海省| 大埔区| 林西县| 永泰县| 民县| 禹城市| 拉萨市| 富顺县| 新安县| 乾安县| 雅江县| 赣州市| 镇原县| 内丘县| 中西区| 永吉县| 大足县| 鹤山市| 丹巴县| 雷山县| 江安县| 若羌县| 波密县| 衡阳县| 青川县| 开封县| 锦州市| 房山区| 竹北市| 汝城县| 洛川县| 敦煌市| 铁岭市| 宣化县| 饶阳县| 商洛市|