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)
Tue, Nov 12, 6:47 PM
Unknown Object (File)
Sun, Nov 10, 7:44 PM
Unknown Object (File)
Sun, Nov 10, 3:02 PM
Unknown Object (File)
Tue, Nov 5, 9:07 AM
Unknown Object (File)
Sun, Nov 3, 9:40 PM
Unknown Object (File)
Fri, Nov 1, 4:51 PM
Unknown Object (File)
Fri, Nov 1, 1:26 AM
Unknown Object (File)
Oct 14 2024, 2:04 PM
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.