mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
BUG/MINOR: pollers: always program an update for migrated FDs
If an MT-aware poller reports that a file descriptor was migrated, it must stop reporting it. The simplest way to do this is to program an update if not done yet. This will automatically mark the FD for update on next round. Otherwise there's a risk that some events are reported a bit too often and cause extra CPU usage with these pollers. Note that epoll is currently OK regarding this. Select does not need this because it uses a single shared events table, so in case of migration no FD change is expected. This should be backported as far as 2.2.
This commit is contained in:
parent
177119bb11
commit
79e90b9615
@ -226,6 +226,8 @@ static void _do_poll(struct poller *p, int exp, int wake)
|
||||
|
||||
if (!(fdtab[fd].thread_mask & tid_bit)) {
|
||||
activity[tid].poll_skip_fd++;
|
||||
if (!HA_ATOMIC_BTS(&fdtab[fd].update_mask, tid))
|
||||
fd_updt[fd_nbupdt++] = fd;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -193,6 +193,8 @@ static void _do_poll(struct poller *p, int exp, int wake)
|
||||
|
||||
if (!(fdtab[fd].thread_mask & tid_bit)) {
|
||||
activity[tid].poll_skip_fd++;
|
||||
if (!HA_ATOMIC_BTS(&fdtab[fd].update_mask, tid))
|
||||
fd_updt[fd_nbupdt++] = fd;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -234,6 +234,8 @@ static void _do_poll(struct poller *p, int exp, int wake)
|
||||
|
||||
if (!(fdtab[fd].thread_mask & tid_bit)) {
|
||||
activity[tid].poll_skip_fd++;
|
||||
if (!HA_ATOMIC_BTS(&fdtab[fd].update_mask, tid))
|
||||
fd_updt[fd_nbupdt++] = fd;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user