Page MenuHomeFreeBSD

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

Authored by wulf on Jan 14 2021, 8:51 PM.
Tags
None
Referenced Files
F108595552: D28169.id82292.diff
Sun, Jan 26, 6:27 PM
Unknown Object (File)
Fri, Jan 24, 5:15 PM
Unknown Object (File)
Fri, Jan 24, 4:08 PM
Unknown Object (File)
Thu, Jan 23, 6:45 PM
Unknown Object (File)
Fri, Jan 17, 12:49 PM
Unknown Object (File)
Dec 26 2024, 2:14 AM
Unknown Object (File)
Nov 22 2024, 3:01 PM
Unknown Object (File)
Nov 19 2024, 11:37 PM

Details

Summary

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 4 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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable