Skip to content

[26.04_linux-nvidia-bos] UBUNTU: [Config] nvidia: Disable default CMA reservation#403

Draft
nvmochs wants to merge 1 commit intoNVIDIA:26.04_linux-nvidia-bosfrom
nvmochs:set_cma0_70_bos
Draft

[26.04_linux-nvidia-bos] UBUNTU: [Config] nvidia: Disable default CMA reservation#403
nvmochs wants to merge 1 commit intoNVIDIA:26.04_linux-nvidia-bosfrom
nvmochs:set_cma0_70_bos

Conversation

@nvmochs
Copy link
Copy Markdown
Collaborator

@nvmochs nvmochs commented May 1, 2026

Summary

Set CONFIG_CMA_SIZE_MBYTES=0 for arm64 linux-nvidia kernels.

This keeps CMA support compiled into the kernel, but stops reserving a default global CMA pool unless one is explicitly requested with the cma= kernel command-line option.

Rationale

The arm64 linux-nvidia kernels previously reserved CMA by default to reduce noisy cma_alloc() failures seen during SMMUv3 initialization on large NVIDIA systems. After further testing, the default CMA pool does not appear to be required for the affected paths. The DMA/IOMMU allocation paths that try CMA also have fallback paths through the normal page allocator, and testing confirms that SMMUv3 queue allocation continues to succeed with cma=0.

Keeping the default CMA pool has become a liability on larger systems because the pool can still be exhausted, which produces misleading kernel log noise even though the allocation fallback succeeds. There is also no existing knob to keep a default CMA pool while suppressing the failed cma_alloc() messages.

Using CONFIG_CMA_SIZE_MBYTES=0 also aligns the arm64 linux-nvidia default with amd64 behavior and with other enterprise arm64 distro kernels, including RHEL and SLES, which use CONFIG_CMA_SIZE_MBYTES=0.

Users that need a default CMA reservation can still opt in with the cma= kernel command-line parameter.

Compatibility

The main user-visible change is that CMA-backed dma-heap nodes are not created by default when there is no default CMA area. For example, with CMA reserved the system exposes:

/dev/dma_heap/default_cma_region
/dev/dma_heap/reserved
/dev/dma_heap/system

With cma=0, only the generic system heap remains:

/dev/dma_heap/system

This is a compatibility consideration for userspace that explicitly opens the CMA-backed heap names. Generic dma-buf system heap users are unaffected.

Validation

Tested with cma=0 on linux-nvidia arm64 systems and guests, including 4K and 64K kernel combinations.

Observed behavior:

  • kernel command line contains cma=0
  • dmesg reports 0K cma-reserved
  • /proc/meminfo reports CmaTotal: 0 kB and CmaFree: 0 kB
  • no __cma_alloc failures
  • no DMA pool exhaustion or DMA out-of-memory messages
  • SMMUv3 cmdq/evtq/priq allocation succeeds
  • atomic DMA pool remains separately preallocated
  • /dev/dma_heap/system remains present

DGX Spark testing also showed a clean boot with cma=0; the only observed dma-heap difference was the expected disappearance of the CMA-backed heap nodes.

Set CONFIG_CMA_SIZE_MBYTES=0 for arm64 linux-nvidia kernels.

Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

PR Validation Report

Patchscan ✅ No Missing Fixes

All cherry-picked commits checked — no missing upstream fixes found.

PR Lint ❌ Errors found

Details
Checking 1 commits...

Cherry-pick digest:
┌──────────────┬───────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local        │ Referenced upstream / Patch subject           │ Patch-ID   │ Subject │ SoB chain                 │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 20632492865c │ [SAUCE] ubuntu: [config] nvidia: disable defa │ N/A        │ N/A     │ mochs                     │
└──────────────┴───────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘

Lint results:
E: 20632492865c ("UBUNTU: [Config] nvidia: Disable default CMA reser"): not SAUCE/Revert but has no upstream reference trailer (cherry picked from commit ... or backported from ...)

PR metadata:
E: PR targets 26.04_linux-nvidia-bos but body has no 'BugLink:' or 'LP:' https://bugs.launchpad.net/... line

@jamieNguyenNVIDIA
Copy link
Copy Markdown
Collaborator

Acked-by: Jamie Nguyen <jamien@nvidia.com>

Copy link
Copy Markdown
Collaborator

@clsotog clsotog left a comment

Choose a reason for hiding this comment

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

Acked-by: Carol L Soto <csoto@nvidia.com>

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.

3 participants