HomeFreeBSD

Remove the mtx_sleep() from the kqueue f_event filter.

Description

Remove the mtx_sleep() from the kqueue f_event filter.

The filter is called from the network hot path and must not sleep.

The filter runs with the descriptor lock held and does not manipulates the
buffers, so it is not necessary sleep when the hold buffer is in use.

Just ignore the hold buffer contents when it is being copied to user space
(when hold buffer in use is set).

This fix the "Sleeping thread owns a non-sleepable lock" panic when the
userland thread is too busy reading the packets from bpf(4).

PR: 200323
MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

Details

Provenance
loosAuthored on
Parents
rS286259: Avoid calling strlen() where we can use the strspn() return value.
Branches
Unknown
Tags
Unknown