Skip to content

NAS-139627 / 26.0.0-BETA.1 / NTB: ntb_transport: Preallocate memory windows#240

Merged
amotin merged 1 commit intotruenas/linux-6.18from
NAS-139627
Feb 11, 2026
Merged

NAS-139627 / 26.0.0-BETA.1 / NTB: ntb_transport: Preallocate memory windows#240
amotin merged 1 commit intotruenas/linux-6.18from
NAS-139627

Conversation

@amotin
Copy link
Collaborator

@amotin amotin commented Feb 11, 2026

Original Linux code allocated memory on every link up and freed on every link down. It may be a problem to allocate several MBs of physically contiguous memory on a running system. To workaround that, speculatively pre-allocate it on boot and then reallocate only if remote host requests different parameters, which should be very rare.

This replicates the logic we used on FreeBSD.

@claude
Copy link

claude bot commented Feb 11, 2026

🤖 Claude is monitoring this PR

I'll review code, respond to comments, and investigate CI failures.
Start any comment with (skip) to have me ignore it.

  • Push fix commits (uncheck to only post review comments)

@bugclerk bugclerk changed the title NTB: ntb_transport: Preallocate memory windows NAS-139627 / 26.0.0-BETA.1 / NTB: ntb_transport: Preallocate memory windows Feb 11, 2026
@bugclerk
Copy link

@amotin amotin requested a review from ixhamza February 11, 2026 18:38
Original Linux code allocated memory on every link up and freed on
every link down.  It may be a problem to allocate several MBs of
physically contiguous memory on a running system.  To workaround
that, speculatively pre-allocate it on boot and then reallocate
only if remote host requests different parameters, which should
be very rare.
@claude
Copy link

claude bot commented Feb 11, 2026

LGTM!

Reviewed the NTB transport memory window DMA buffer pre-allocation changes, and everything looks solid. The approach to allocate buffers at probe time and maintain them across link cycles should effectively prevent the expensive contiguous memory allocation failures.

@amotin amotin merged commit 5d580e0 into truenas/linux-6.18 Feb 11, 2026
6 checks passed
@amotin amotin deleted the NAS-139627 branch February 11, 2026 21:19
@bugclerk
Copy link

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Feb 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants