HomeFreeBSD

vfs: fix vn_poll performance with either MAC or AUDIT

Description

vfs: fix vn_poll performance with either MAC or AUDIT

The code would unconditionally lock the vnode to audit or call the
mac hoook, even if neither want to do anything. Pre-check the state
to avoid locking in the common case of nothing to do.

Note this code should not be normally executed anyway as vnodes are
always return ready. However, poll1/2 from will-it-scale use regular
files for benchmarking, presumably to focus on the interface itself
as the vnode handler is not supposed to do almost anything.

This in particular fixes poll2 which passes 128 fds.

$ ./poll2_processes -s 10
before: 134411
after: 271572

Details

Provenance
mjgAuthored on
Parents
rS363248: Remove old devd rules for ActiveWire and Entrega Serial DB25
Branches
Unknown
Tags
Unknown