Summary: | Linuxulator: epoll create drop user data | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | shu <ankohuu> | ||||||||||
Component: | kern | Assignee: | freebsd-emulation (Nobody) <emulation> | ||||||||||
Status: | Closed FIXED | ||||||||||||
Severity: | Affects Some People | CC: | dchagin, emaste, trasz, wulf | ||||||||||
Priority: | --- | ||||||||||||
Version: | CURRENT | ||||||||||||
Hardware: | Any | ||||||||||||
OS: | Any | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 247219 | ||||||||||||
Attachments: |
|
Created attachment 221465 [details]
patch for linux epoll create
Created attachment 221517 [details]
drop_epoll_data.patch
Could you test this patch instead of your?
Created attachment 221549 [details]
epoll test code
Tested already, it works fine for me. Test case is in the attachment. Committed in b3c6fe663bb9 merged to stable/13, I don't plan to merge it to stable/12 |
Created attachment 221464 [details] patch for epoll create In function epoll_create_common calls epoll_fd_install when kern_kqueue success, I guess this is to initialize the proc emuldata space. But when epoll has allocated a descriptor equal to EPOLL_DEF_SZ, the above action will clear the user data of fd EPOLL_DEF_SZ.This should be an error. static int epoll_create_common(struct thread *td, int flags) { int error; error = kern_kqueue(td, flags, NULL); if (error != 0) return (error); epoll_fd_install(td, EPOLL_DEF_SZ, 0); return (0); } In my scenario, the function epoll_fd_install will cause the electron gpu thread consumes a lot of cpu resources because the returned fd cannot be processed correctly. My patch is in the attachment.