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)
Tue, Jul 16, 10:41 PM
Unknown Object (File)
Tue, Jul 9, 6:25 PM
Unknown Object (File)
Sat, Jul 6, 2:20 PM
Unknown Object (File)
Fri, Jun 28, 1:03 PM
Unknown Object (File)
Jun 12 2024, 10:35 AM
Unknown Object (File)
May 21 2024, 6:15 PM
Unknown Object (File)
May 16 2024, 8:26 AM
Unknown Object (File)
May 14 2024, 12:43 PM
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