Skip to content

iommu/arm-smmu-v3: Make the queue depths tunable, and shrink them in a kdump kernel

Kiryl Shutsemau (Meta) linux-arm-kernel linux-iommu linux-tegra lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 7 repliesIn review
  2. v52 patches 5 repliesSuperseded
  3. v42 patches 6 repliesSuperseded

Changes in v6 from the cover letter

- Take the parameter as a log2 depth and call it cmdq_max_n_shift (Nicolin).
- Nicolin's Reviewed-by and Tested-by from v5 are not carried over, as the parameter changed shape.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2iommu/arm-smmu-v3: Add a cmdq_max_n_shift module parameterdrivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c+43 -35 replies
2/2iommu/arm-smmu-v3: Default queue depths to one page in a kdump kerneldrivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c+29 -72 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchYuanhe ShuBreno LeitaoJason Gunthorpe
1/2R-b R-b
2/2T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/2] iommu/arm-smmu-v3: Make the queue depths tunable, and shrink them in a kdump kernel

The queues are sized from the IDR1 maxima and allocated at probe, costing megabytes per queue per SMMU instance. A kdump capture kernel pays that out of a small crashkernel reservation, for queues it barely uses and two of which it switches off anyway.

Patch 1 adds a cmdq_max_n_shift module parameter, decided in a per-queue helper and floored at one page. Patch 2 has a kdump kernel default all three depths to one page through the same helper. An explicit cmdq_max_n_shift still wins.

Measured per instance under QEMU on -M virt,iommu=smmuv3, through a real panic and kexec into a capture kernel:

                        4K page          64K page
      cmdq         1 MB -> 4 KB      8 MB -> 64 KB
      evtq         1 MB -> 4 KB     16 MB -> 64 KB

Every clamped queue lands on exactly one page. cmdq_max_n_shift moves the command queue alone and beats the kdump default; the capture kernel attached four devices with no CMD_SYNC timeout, GERROR or context fault. QEMU exposes no PRI queue, which takes the same path. Build-tested across 4K/16K/64K, TEGRA241_CMDQV=n, CRASH_DUMP=n and =m, every commit warning-free.

v6:
- Take the parameter as a log2 depth and call it cmdq_max_n_shift (Nicolin).
- Nicolin's Reviewed-by and Tested-by from v5 are not carried over, as the parameter changed shape.

v5: https://lore.kernel.org/all/[email protected]/
v4: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/

Kiryl Shutsemau (Meta) (2):
iommu/arm-smmu-v3: Add a cmdq_max_n_shift module parameter iommu/arm-smmu-v3: Default queue depths to one page in a kdump kernel

 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c   | 75 +++++++++++++++++--
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   |  1 +
 .../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c    |  2 +-
 3 files changed, 70 insertions(+), 8 deletions(-)

base-commit: cee9395acd8043be0644b25c34bfa86623f2b935

Signature · 1 line
2.54.0