Page MenuHomeFreeBSD

aio: micro-optimize the lio_opcode assignments
ClosedPublic

Authored by asomers on Jan 3 2021, 3:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 8, 12:28 PM
Unknown Object (File)
Sun, Jan 8, 12:27 PM
Unknown Object (File)
Dec 23 2022, 5:47 AM
Unknown Object (File)
Dec 2 2022, 9:45 AM
Subscribers

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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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