Page MenuHomeFreeBSD

nvme: Convert adjacent bools to a bitfield
AbandonedPublic

Authored by imp on Aug 3 2023, 10:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 11, 12:27 AM
Unknown Object (File)
Sat, May 11, 12:27 AM
Unknown Object (File)
Fri, May 10, 8:16 PM
Unknown Object (File)
Thu, May 9, 10:49 PM
Unknown Object (File)
Thu, May 9, 11:05 AM
Unknown Object (File)
Tue, Apr 23, 12:18 AM
Unknown Object (File)
Dec 20 2023, 5:33 AM
Unknown Object (File)
Nov 1 2023, 8:52 AM
Subscribers

Details

Reviewers
jhb
mav
chuck
chs
Summary

Neither timeout (meaning this request is allowed to timeout), nor
payload_valid (meaning this request has a memdesc that's good) are set
in a way that race anything (these are set during initializaiton and then
only tested).

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 52971
Build 49862: arc lint + arc unit

Event Timeline

imp requested review of this revision.Aug 3 2023, 10:41 PM

I suppose it may not save anything on 64-bit platforms due to alignment.

I kind of doubt this makes a difference due to padding (I suspect you have padding here both before and after if you check ptype /o in GDB). Probably there's a hole after retries that you could move these two down into that might remove some padding making the structure smaller.

This revision is now accepted and ready to land.Aug 5 2023, 12:13 AM
In D41312#941078, @jhb wrote:

I kind of doubt this makes a difference due to padding (I suspect you have padding here both before and after if you check ptype /o in GDB). Probably there's a hole after retries that you could move these two down into that might remove some padding making the structure smaller.

This has more to do with wanting more booleans... but I suppose that there's a total of 8 before we overflow so maybe I should just abandon this...

If you are looking to add more flag values, I'd move this to after retries and change the type to uint32_t or uint16_t if you think more might be needed in the future.

If you are looking to add more flag values, I'd move this to after retries and change the type to uint32_t or uint16_t if you think more might be needed in the future.

I've dropped this, and likely will move the bools to a 64-bit slot and make it be an array of 8 - #used-booleans to be explicit about padding.