Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARC: Pack b_byteswap in struct arc_buf_hdr #15341

Closed
wants to merge 2 commits into from

Conversation

amotin
Copy link
Member

@amotin amotin commented Oct 3, 2023

While b_byteswap rightfully belongs in struct l1arc_buf_hdr, it does not pack there efficiently. Move it to struct arc_buf_hdr allows to reduce L1 ARC header size by 8 bytes, down to 176 bytes on FreeBSD.

This PR conflicts with #15340, so for now includes it as separate commit.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

amotin added 2 commits October 2, 2023 17:33
Earlier as part of openzfs#14123 I've removed one use of b_cv.  This patch
reuses the same approach to remove the other one from much more
rare code path.

This saves 16 bytes of L1 ARC header on FreeBSD (reducing it from
200 to 184 bytes) and seems even more on Linux.

Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
While b_byteswap rightfully belongs in struct l1arc_buf_hdr, it does
not pack there efficiently.  Move it to struct arc_buf_hdr allows to
reduce L1 ARC header size by 8 bytes, down to 176 bytes on FreeBSD.

Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
@amotin amotin added the Status: Code Review Needed Ready for review and testing label Oct 3, 2023
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame there isn't an efficient place to stash this in the l1arc_buf_hdr, but that does seem to be the case. Given the savings to be had by moving this it LGTM.

@amotin
Copy link
Member Author

amotin commented Oct 4, 2023

I am thinking may be I could remove b_bufcnt from l1arc_buf_hdr. In such case this patch won't be needed. I'll investigate this tomorrow.

@amotin
Copy link
Member Author

amotin commented Oct 4, 2023

In #15350 I was able to remove b_bufcnt from l1arc_buf_hdr, that allows to avoid this commit. Closing it.

@amotin amotin closed this Oct 4, 2023
@amotin amotin deleted the b_byteswap branch October 5, 2023 00:56
@amotin amotin removed the Status: Code Review Needed Ready for review and testing label Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants