??????????????????????????????????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????????