]> git.ipfire.org Git - thirdparty/unbound.git/commit
Update mini_event.c 521/head
authorliheng562653799 <47775671+liheng562653799@users.noreply.github.com>
Fri, 6 Aug 2021 04:00:56 +0000 (12:00 +0800)
committerGitHub <noreply@github.com>
Fri, 6 Aug 2021 04:00:56 +0000 (12:00 +0800)
commitedbf9c21ee5c32f4ef52c2e3a16868fccc2d82e6
tree1708518eb91ff1c39aa71e160d7d120ef0a8a470
parent8e538dcaa8df2d0fab8ff3dcf94ac1f972450b66
Update mini_event.c

When in heavy load, unbound opens many outside_network sockets for out going queries to delegation servers, which may result in a big fd(maxfd) value(for thread A 65500, for thread B 65501, for thread C ...).
There are situations when thread A has a max fd num 65500 where maxfd is of course 65500, thread B has max fd num 20 for now but maxfd is still 65501. Though linux kernel checks whether maxfd+1  passed by select syscall  is really the process' maxfd+1. Linux kernel can not tell maxfd+1 passed by thread B select syscall is much bigger(65501+1 or 65500+1  after trimed by kerne) than it should be (20+1).
In this situation, when kernel do_select() for thread B, much work is wasted.
util/mini_event.c