HomeFreeBSD

epoll: Store epoll_event udata member in ext member of kevent.

Description

epoll: Store epoll_event udata member in ext member of kevent.

Current epoll implementation stores udata fields of epoll_event
structure in special dynamically-sized table rather than in udata field
of backing kevent structure because of 2 reasons:

  1. Kevent's udata size is smaller than epoll's on 32-bit archs.
  2. Kevent's udata can be clobbered on execution EPOLL_CTL_ADD as kqueue modifies existing event while epoll returns error in this case.

After r320043 has introduced four new 64bit user data members (ext[]),
we can store epoll udata in one of them and drop aforementioned table.
According to kqueue_register() source code ext members are not updated
when existing kevent is modified that fixes p.2.

As a side effect the patch fixes PR/252582.

Reviewed by: trasz
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D28169

(cherry picked from commit b3c6fe663bb90240f8bda6b5ba9c6a761f09f078)

Details

Provenance
wulfAuthored on Feb 7 2021, 11:46 PM
Reviewer
trasz
Differential Revision
D28169: epoll: Store epoll_event udata member in ext member of kevent.
Parents
rG9f7ff9fe8450: Remove tmpfs size and properly format generated fstab for arm
Branches
Unknown
Tags
Unknown