Skip to content

Commit fe54baf

Browse files
Recap SWIOTLB to the minimum. (#794)
Some time after originally capping the SWIOTLB at 1 MiB, the SWIOTLB was split into per-CPU areas. This increased the memory usage considerably. Clamp the number of areas at 1 to reduce the memory usage again. This impacts ARM64 and TDX. On a 64 VP ARM machine, this change saves ~22MiB, ~18 MiB on TDX.
1 parent e74f61e commit fe54baf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openhcl/openhcl_boot/src/main.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ fn build_kernel_command_line(
153153
"unknown_nmi_panic=1",
154154
// Even with iommu=off, the SWIOTLB is still allocated on AARCH64
155155
// (iommu=off ignored entirely), and CVMs (memory encryption forces it on).
156-
// Set it to the minimum, saving ~63 MiB.
157-
"swiotlb=1",
156+
// Set it to the minimum, saving ~63 MiB. The first parameter controls the
157+
// area size, the second controls the number of areas (default is # of CPUs).
158+
// Set them both to the minimum.
159+
"swiotlb=1,1",
158160
// Use vfio for MANA devices.
159161
"vfio_pci.ids=1414:00ba",
160162
// WORKAROUND: Enable no-IOMMU mode. This mode provides no device isolation,

0 commit comments

Comments
 (0)