mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v5 0/2] iommu/arm-smmu-v3: Make the queue depths tunable, and shrink them in a kdump kernel
@ 2026-09-07  9:58 Kiryl Shutsemau (Meta)
  2026-09-07  9:58 ` [PATCH v5 1/2] iommu/arm-smmu-v3: Add a cmdq_max_entries module parameter Kiryl Shutsemau (Meta)
  2026-09-07  9:58 ` [PATCH v5 2/2] iommu/arm-smmu-v3: Default queue depths to one page in a kdump kernel Kiryl Shutsemau (Meta)
  0 siblings, 2 replies; 8+ messages in thread
From: Kiryl Shutsemau (Meta) @ 2026-09-07  9:58 UTC (permalink / raw)
  To: Will Deacon, Robin Murphy, Joerg Roedel, Nicolin Chen
  Cc: Jason Gunthorpe, Pranjal Shrivastava, Mostafa Saleh,
	Thierry Reding, Krishna Reddy, Jonathan Hunter, Breno Leitao,
	Kyle McMartin, Usama Arif, kernel-team, linux-arm-kernel, iommu,
	linux-tegra, linux-kernel, Kiryl Shutsemau (Meta)

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_entries 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_entries 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_entries 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.

v5:
 - Rename cmdq_entries to cmdq_max_entries (Nicolin).
 - Take Nicolin's refactor: ceiling/floor naming, the alignment cap inside
   the per-queue helpers, evtq/priq helpers, FIELD_GET() at the call sites.
 - Keep the override in entries rather than a shift: ilog2(1) is 0 and
   collides with the "use the default" sentinel, so cmdq_max_entries=1
   would have given the hardware maximum instead of the floor.
 - min() for min_t() now that the types allow it. Changelogs tightened.

v4: https://lore.kernel.org/all/20260902121724.3494954-1-kas@kernel.org/
v3: https://lore.kernel.org/all/20260706084708.8072-1-kas@kernel.org/

Kiryl Shutsemau (Meta) (2):
  iommu/arm-smmu-v3: Add a cmdq_max_entries 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   | 78 +++++++++++++++++--
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   |  1 +
 .../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c    |  2 +-
 3 files changed, 73 insertions(+), 8 deletions(-)


base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
-- 
2.54.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-09-09  9:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07  9:58 [PATCH v5 0/2] iommu/arm-smmu-v3: Make the queue depths tunable, and shrink them in a kdump kernel Kiryl Shutsemau (Meta)
2026-09-07  9:58 ` [PATCH v5 1/2] iommu/arm-smmu-v3: Add a cmdq_max_entries module parameter Kiryl Shutsemau (Meta)
2026-09-07 21:56   ` Nicolin Chen
2026-09-08  9:19     ` Kiryl Shutsemau
2026-09-08 21:56       ` Nicolin Chen
2026-09-09  9:50         ` Kiryl Shutsemau
2026-09-07  9:58 ` [PATCH v5 2/2] iommu/arm-smmu-v3: Default queue depths to one page in a kdump kernel Kiryl Shutsemau (Meta)
2026-09-07 21:57   ` Nicolin Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®