gpt4 book ai didi

linux - 什么linux内核C函数schedule()出现 "need_resched:"是什么意思

转载 作者:太空宇宙 更新时间:2023-11-04 12:42:19 25 4
gpt4 key购买 nike

need_resched:
preempt_disable();
cpu = smp_processor_id();
rq = cpu_rq(cpu);
rcu_note_context_switch(cpu);
prev = rq->curr;
switch_count = &prev->nivcsw;

release_kernel_lock(prev);

我想问的是:“need_resched:”有什么作用。

具体来说,linux内核版本是2.6.35.3。

最佳答案

need_schedule: 只是一个标签。稍后在代码中您会发现:

if (need_resched())
goto need_resched;

即,如果设置了重新安排标志(由 need_reschedule() 测试),代码中的这一点将(再次)执行。

关于linux - 什么linux内核C函数schedule()出现 "need_resched:"是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39802305/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com