????λ?????????? >> ???????????
?????????Linux?豸?????е????????????I/O
???????????? ???????[ 2015/6/4 13:45:51 ] ??????????????
???????????豸?????е?poll()????????????????£?
????static unsigned int poll(struct file *file?? struct socket *sock??poll_table *wait)
????//???????????file????????????????????????????????????y?????????
??????????????豸??????仯???????е???poll_wait()????????????????????????poll_table
?????????????????豸??????????????д?????????
???????????poll_wait()??????????????????wait_event()?????????????????????????????????????????????????????????????????????????????????wait????????????б?poll_table?????poll_wait()??????????£?
????static inline void poll_wait(struct file * filp?? wait_queue_head_t * wait_address?? poll_table *p)
???????п?????????????????wait_address????p???????????(poll_table)
?????????????е?poll()??????????????£?
static unsigned int xxx_poll(struct file *filp??struct socket *sock??
poll_table *wait)
{
unsigned int mask = 0;
struct xxx_dev *dev = filp->private_data;
//????豸???????
...
poll_wait(filp??&dev->r_wait??wait);
//?????????????poll_table
poll_wait(filp??&dev->w_wait??wait);
//??д??????????poll_table
...
if(...)
//???
mask |= POLLIN | POLLRDNORM;
if(...)
//??д
mask |= POLLOUT | POLLRDNORM;
...
return mask;
}
????????????????????globalfifo????
??????globalfifo??poll()?????У???????豸???????r_wait??w_wait?????????????????б??globalfifo?豸??????poll()???????£?
static unsigned int gloablfif0_poll(struct file *filp??poll_table *wait)
{
unsigned int mask = 0;
struct globalfifo_dev *dev = filp->private_data;
down(&dev->sem);
poll_wait(filp??&dev->r_wait ?? wait) ;
poll_wait(filp??&dev->r_wait ?? wait) ;
if(dev->current_len != 0)
{
mask |= POLLIN | POLLRDNORM;
}
if(dev->current_len != GLOBALFIFO_SIZE)
{
mask |= POLLOUT | POLLWRNORM;
}
up(&dev->sem);
return mask;
}
??????????
?????????????????????
???????岢???????????????
???????岢???????????У?
????????????????????????
???????y???????TASK_INTERRUPTIBLE???????????????TASK_UNINTERRUPTIBLE???????????????
????????????????
????poll?????
????????????????poll_table
?????????????????豸??????????????д?????????
???????????????????????漰???????????????????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 ??????