Linux????е????
???????????? ???????[ 2012/12/6 10:30:33 ] ????????
??????????????????????????????????Linux??????????????????????????????????е????н??????????Linux????????????????в???????????????????
????Linux??????O(1)?????????????????????????????????????????????е??????в?????2.6.23???汾??????????????????CFS????????O(1)????????
???????????????I/O???????????????????I/O????????????????????????I/O?????????I/O????????????????????????????????????д??????????????????????ì???????????????????????????????Linux???????????????I/O??????????
??????????????????????δ?t???????????????????С?
????Linux???????????????????Χ?????????nice???????nice???ζ?????????????????????????????????????????????????????????ζ???????????????κ???????????????????????????
????CFS???????????????????????????????????????????????????????????н????????????÷????????????????????????CFS?????п????н??????????????????????????????ж?????????????nice?????????????CFS???????????????????????С????????????1ms????nice????????????????κν?????????????????????????????????п????н???nice????????????
????Linux?????????
??????????
????????????????struct sched_entity??????????????????struct task_struct?С??????????ns???λ??????vruntime?????У????????????????????vruntime??????????????????????????????????????????????????е?????
???????????
??????CFS??????????????н???????????????????Сvruntime??????????CFS??????????????????С??vruntime????????????ú?????????
?????????????
?????????????????????schedule???????ú?????????????????????????μ?????????????????????????????????У????????????????
???????????
???????????????????????????????????????????????к????????????????????У???????schedule???????????????????????????????????????????????????????????????????????????????к?????С?
?????????????????????TASK_INTERRUPTIBLE??TASK_UNINTERRUPTIBLE??????????????????TASK_UNINTERRUPTIBLE?????????????????TASK_INTERRUPTIBLE????????????????????????????????????????????????????λ????????????????????Щ???飬????????С?
??????????????????????????????????????????????????????????????????????????????????ɡ?
??????????е????
????static DECLARE_WAIT_QUEUE_HEAD(button_waitq); //???????????
????wait_event_interruptible(button_waitq?? ev_press); //????
????wake_up_interruptible(&button_waitq); //????
????????????????л?
???????????л???????????н????л????????????н????Schedule????????????????????????????????????????????????л?????????С??????????????????????????л??????????????????
???????????????????????schedule????????ν?????????????????????schedule???????????????????????????????????????need_resched????????????????????????ε??????????????????????????????????????????????????????????????????????
??????????
???????????????????????????need_resched??????????????schedule????????????????????????????????????????????????????????????÷????????????????????ж??????????????????
??????????
??????2.6??????У??????????????????????μ????????????????г????????????????κ?????????????е?????????????????????????????thread_info????preempt_count?????????????????????á?????????????????????????????ж?????????????У??????????????????????????????ξ??п???????????????????????е?????????????schedule??????????????????е????????????????????schedule????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11