From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
To: Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Joerg Roedel <joro@8bytes.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>,
Nicolin Chen <nicolinc@nvidia.com>,
Pranjal Shrivastava <praan@google.com>,
Mostafa Saleh <smostafa@google.com>,
Thierry Reding <thierry.reding@kernel.org>,
Krishna Reddy <vdumpa@nvidia.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Breno Leitao <leitao@debian.org>, Kyle McMartin <jkkm@meta.com>,
Usama Arif <usama.arif@linux.dev>,
kernel-team@meta.com, linux-arm-kernel@lists.infradead.org,
iommu@lists.linux.dev, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Kiryl Shutsemau (Meta)" <kas@kernel.org>
Subject: [PATCH v4 0/2] iommu/arm-smmu-v3: Make the queue depths tunable, and shrink them in a kdump kernel
Date: Wed, 2 Sep 2026 13:17:22 +0100 [thread overview]
Message-ID: <20260902121724.3494954-1-kas@kernel.org> (raw)
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.
v3 clamped every queue to a page under is_kdump_kernel(). Review wanted a
general mechanism instead, so patch 1 adds a cmdq_entries module parameter
at the max_n_shift initialisation in arm_smmu_device_hw_probe() (Robin),
command queue only (Will), floored at one page (Jason). Patch 2 then has a
kdump kernel default all three depths to one page through the same helper,
with no command line needed (Jason). An explicit cmdq_entries still wins.
The v3 Reviewed-by from Breno, Pranjal, Jason and Nicolin, and Nicolin's
Tested-by, are dropped: this is not the patch they were given to.
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_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, so
batching survives the floor. QEMU exposes no PRI queue, which takes the
same path. Also build-tested across 4K/16K/64K, TEGRA241_CMDQV=n,
CRASH_DUMP=n and =m, every commit warning-free.
The kdump stream table adoption series drops the event and PRI allocations
outright as of its v10. This sits on the same base, applies on top with no
conflict, and sizes the command queue that series leaves alone.
v3: https://lore.kernel.org/all/20260706084708.8072-1-kas@kernel.org/
Kiryl Shutsemau (Meta) (2):
iommu/arm-smmu-v3: Add a cmdq_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 | 61 +++++++++++++++++--
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 +
.../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 5 +-
3 files changed, 59 insertions(+), 8 deletions(-)
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
--
2.54.0
next reply other threads:[~2026-09-02 12:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 12:17 Kiryl Shutsemau (Meta) [this message]
2026-09-02 12:17 ` [PATCH v4 1/2] iommu/arm-smmu-v3: Add a cmdq_entries module parameter Kiryl Shutsemau (Meta)
2026-09-02 17:22 ` Nicolin Chen
2026-09-03 14:15 ` Kiryl Shutsemau
2026-09-03 15:09 ` Nicolin Chen
2026-09-02 12:17 ` [PATCH v4 2/2] iommu/arm-smmu-v3: Default queue depths to one page in a kdump kernel Kiryl Shutsemau (Meta)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260902121724.3494954-1-kas@kernel.org \
--to=kas@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=jkkm@meta.com \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--cc=praan@google.com \
--cc=robin.murphy@arm.com \
--cc=smostafa@google.com \
--cc=thierry.reding@kernel.org \
--cc=usama.arif@linux.dev \
--cc=vdumpa@nvidia.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).