Page MenuHomeFreeBSD

aio: micro-optimize the lio_opcode assignments
ClosedPublic

Authored by asomers on Jan 3 2021, 3:46 PM.

Details

Summary

This allows slightly more efficient opcode testing in-kernel. It is
transparent to userland, except to applications that sneakily submit
aio fsync or aio mlock operations via lio_listio, which has never been
documented, requires the use of deliberately undefined constants
(LIO_SYNC and LIO_MLOCK), and is arguably a bug.

Test Plan

existing AIO test suite

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 36075
Build 32964: arc lint + arc unit

Event Timeline

Looks OK to me. I suppose we could also use bitmask style for LIO_SYNC and LIO_DATA_ONLY?

This seems ok to me, though it's not clear if the optimizations really buy anything in perf compared to the (minimal) obfuscation when reading.

I would very much like to see missing validation of opcodes to lio_listio added though, perhaps as a prior commit before this?

  • aio: micro-optimize the lio_opcode assignments
  • Rebase to include LIO_DSYNC

I rebased. I'll open a separate review to validate lio_listio opcodes.

  • aio: micro-optimize the lio_opcode assignments
  • Rebase to include LIO_DSYNC

Rebased to include lio_listio opcode validation.

This revision is now accepted and ready to land.Jan 19 2021, 6:53 PM