Linux???????????????
???????????? ???????[ 2014/9/12 10:48:56 ] ?????????????? Linux
????B????:
????100 spin_lock(&list_lock);
????101 list_add_tail(&list_head?? new_node);
????102 spin_unlock(&list_lock);
????103 wake_up_process(processa_task);
??????????????????????統(tǒng)A??????е???3?к??4????????B????????????????????????????С?????????????B????????????????е????????????????A????????????A???????н???????????????????Ч?????????A ?????????У???????????????????????????????????????????????TASK_INTERRUPTIBLE??????schedule()????????????????B???????????????????????????????????Ч??????????????????????????????????A ???????????????
????3????????Ч????
??????α?????Ч????????????????????Ч???????????????????????????????????????????? ????B?????wake_up_process()??????ν?A?????????TASK_RUNNING ??????????????A????????????TASK_RUNNING??????wake_up_process()??A???????????????????????????? ????????????á????????????????????????????????ж????????????y?????????????????????????????У????????????????? ???????????????????????????wake_up_process ()????????????????????????????????
???????????????????????A???????????????????????????е???Ч???????????
????A????:
1 set_current_state(TASK_INTERRUPTIBLE);
2 spin_lock(&list_lock);
3 if(list_empty(&list_head)) {
4 spin_unlock(&list_lock);
5 schedule();
6 spin_lock(&list_lock);
7 }
8 set_current_state(TASK_RUNNING);
9
10 /* Rest of the code ... */
11 spin_unlock(&list_lock);
???????????????δ?????????????????????н?????????ó?TASK_INTERRUPTIBLE????????????????????????????????TASK_RUNNING??????????????B??????A????????????????????????wake_up_process()?????A?????????????????TASK_INTERRUPTIBLE???TASK_RUNNING?????????????????schedule()?????????????????TASK_RUNNING??????????????????ж????????????????????????????????????????Ч????????
????4??Linux????????
??????Linux???????У???????????????????????????Linux??????????г?????Ч????????Linux????????????????????????????????μ??????
????/* ‘q’??????????????????? */
????DECLARE_WAITQUEUE(wait??current);
????add_wait_queue(q?? &wait);
????set_current_state(TASK_INTERRUPTIBLE);
????/* ??TASK_INTERRUPTIBLE */
????while(!condition) /* ‘condition’ ??????????*/
????schedule();
????set_current_state(TASK_RUNNING);
????remove_wait_queue(q?? &wait);
????????????????y??????????????в??譎??????????????????????н??????????????DECLARE_WAITQUEUE ()?????????????е?????????add_wait_queue()?????????????????У?????????????????? TASK_INTERRUPTIBLE ????TASK_INTERRUPTIBLE????????????????????棺?????????б?????????????????棬????schedule()???????? ????????????????????????????TASK_RUNNING ??????remove_wait_queue()??????????????С?
??????????????????Linux????????????????????????????????y??????????????
???????????????????????????????????????????????????????????????set_current_state()???????????????????????????????????????????????????????????????3?????Ч????????
????????????????linux ????е??????????Linux ???????α?????Ч???????δ??????Linux2.6?????(linux-2.6.11/kernel/sched.c: 4254):
????4253 /* Wait for kthread_stop */
????4254 set_current_state(TASK_INTERRUPTIBLE);
????4255 while (!kthread_should_stop()) {
????4256 schedule();
????4257 set_current_state(TASK_INTERRUPTIBLE);
????4258 }
????4259 __set_current_state(TASK_RUNNING);
????4260 return 0;
???????????Щ?????????????????migration_thread??????????????kthread_should_stop()?????kthread_should_stop()????1?????????????????????kthread_should_stop()????0?y??????? ?????????????????????????kthread_should_stop()?????????????????TASK_INTERRUPTIBLE???????е?????????????????????????schedule()???????????????????????????y???????????????Ч??
????С??
??????????????????????????Linux ?б?????????Ч??????????????????????????????????TASK_INTERRUPTIBLE??TASK_UNINTERRUPTIBLE?????????????????????????y??????????????TASK_RUNNING???????????????????????????? ??????????????????????ж???????????????????????????Ч????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Linux??????DDR????????????Linux?????????????????豸??????????linux???в???????????м??????????????????????????Linux????Linux??DNS????????????γ???????????Linux?????????????Linux????(???)????????Linux ????????????????????????????????Windows???У?Linux???????Linux????????????????Linux iommu??vfio???????Linux????ε???TCP???????Linux?????????????СLinux?·???????????Linux???Jexus?й?Asp.Net Core??ó???Linux?????????Щ??
???·???
??????????????????
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????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????