Skip to content

Avoid more abd_t allocations in RAIDZ/dRAID#18668

Open
amotin wants to merge 1 commit into
openzfs:masterfrom
amotin:abdstruct
Open

Avoid more abd_t allocations in RAIDZ/dRAID#18668
amotin wants to merge 1 commit into
openzfs:masterfrom
amotin:abdstruct

Conversation

@amotin

@amotin amotin commented Jun 12, 2026

Copy link
Copy Markdown
Member

RAIDZ/dRAID allocate rc_abdstruct for every column, but used it only for data columns, while parity columns allocated additional abd_t's on top of that. This change introduces abd_alloc_linear_struct(), abd_alloc_gang_struct() and abd_get_zeros_struct() to the ABD API, mirroring the existing abd_get_offset_struct() pattern, and uses them to use rc_abdstruct in remaining column cases.

How Has This Been Tested?

Profiles of RAIDZ2 write tests show a percent of ZIO pipeline CPU saved.

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)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • 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 amotin added the Status: Code Review Needed Ready for review and testing label Jun 15, 2026

@robn robn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, good improvement, nice one.

@behlendorf behlendorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jun 24, 2026
RAIDZ/dRAID allocate rc_abdstruct for every column, but used it only
for data columns, while parity columns allocated additional abd_t's
on top of that.  This change introduces abd_alloc_linear_struct(),
abd_alloc_gang_struct() and abd_get_zeros_struct() to the ABD API,
mirroring the existing abd_get_offset_struct() pattern, and uses
them to use rc_abdstruct in remaining column cases.

Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
@github-actions github-actions Bot removed the Status: Accepted Ready to integrate (reviewed, tested) label Jun 24, 2026
@behlendorf

Copy link
Copy Markdown
Contributor

I've rebased this PR on master to get another CI run with this change and #18695 both applied. There shouldn't be any issue, but no harm in making sure.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants