Page MenuHomeFreeBSD

Move backend-specific fields of kaiocb into a union.
ClosedPublic

Authored by jhb on May 24 2016, 10:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 6 2024, 5:14 AM
Unknown Object (File)
May 6 2024, 5:11 AM
Unknown Object (File)
May 5 2024, 1:12 PM
Unknown Object (File)
May 3 2024, 12:34 AM
Unknown Object (File)
Mar 23 2024, 1:41 AM
Unknown Object (File)
Mar 2 2024, 4:47 PM
Unknown Object (File)
Feb 19 2024, 10:17 PM
Unknown Object (File)
Feb 16 2024, 6:10 AM
Subscribers

Details

Summary

Move backend-specific fields of kaiocb into a union.

This reduces the size of kaiocb slightly. I've also added some generic
fields that other backends can use in place of the BIO-specific fields.

Change the socket and Chelsio DDP backends to use 'backend3' instead of
abusing _aiocb_private.status directly. This confines the use of
_aiocb_private to the AIO internals in vfs_aio.c.

Test Plan
  • Ran AIO regression tests.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Move backend-specific fields of kaiocb into a union..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: kib.

I went with two pointers to match what cdev, etc. does. I have some pending patches that make use of backend1. Having a long to track partially completed status is useful, and the space is sitting there anyway, so I think it's cleaner to use backend3 rather than _aiocb_private.

I'm not a huge fan of the 'backendX' names. If you have suggestions for a better one please share.

cem added inline comments.
sys/sys/aio.h
146–148 ↗(On Diff #16824)

driver1/2/3 to match bio/buf?

In D6547#138388, @jhb wrote:

I'm not a huge fan of the 'backendX' names. If you have suggestions for a better one please share.

At least you can give backend* a reasonable names with #defines in the backends where the purpose of the members is known. I see no reason to use raw placeholder names in cxgbe, for instance.

In D6547#138591, @kib wrote:
In D6547#138388, @jhb wrote:

I'm not a huge fan of the 'backendX' names. If you have suggestions for a better one please share.

At least you can give backend* a reasonable names with #defines in the backends where the purpose of the members is known. I see no reason to use raw placeholder names in cxgbe, for instance.

Yes, I almost did that originally. I will do that now.

sys/sys/aio.h
146–148 ↗(On Diff #16824)

That could work. The only possible thing there is that not all backends are drivers (e.g. the generic socket backend in sys_socket.c isn't really a driver). bio also has bio_caller1/2.

It would also be a bit nicer if the kaiocb fields all had some reasonable prefix (aio_*) but that's a separate issue.

jhb edited edge metadata.
  • Use macros to give more meaningful names to 'backend*' in AIO backends.
sys/sys/aio.h
146–148 ↗(On Diff #16824)

bio also has bio_caller1/2.

Right, but these are for the opposite end of things (not the backend(s)).

kib edited edge metadata.

With defines, you do not need anon unions.

This revision is now accepted and ready to land.May 26 2016, 7:37 PM
jhb edited edge metadata.
  • Remove now-bogus assertion.
This revision now requires review to proceed.Jun 1 2016, 5:17 PM
jhb edited edge metadata.
  • Add an additional field to hold a pending error value.
This revision was automatically updated to reflect the committed changes.