From: Baolu Lu <baolu.lu@linux.intel.com>
To: "Adrian Mardare (amardare)" <amardare@cisco.com>,
"dwmw2@infradead.org" <dwmw2@infradead.org>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Cc: baolu.lu@linux.intel.com
Subject: Re: Make intel iommu disable swiotlb
Date: Wed, 5 Feb 2025 18:35:20 +0800 [thread overview]
Message-ID: <8b2e868e-2b0d-49dc-b703-4e33138a03b4@linux.intel.com> (raw)
In-Reply-To: <SA1PR11MB6687F4E752138AAED3FC980DCDED2@SA1PR11MB6687.namprd11.prod.outlook.com>
On 2025/1/26 13:09, Adrian Mardare (amardare) wrote:
> (resending as plain-text)
> Hi...
> I'd like to submit the below patch.
> While investigating a difference in memory consumption between the kernel in 5.4.x and in 6.6.x,
> I noticed there is around ~80M less reported in MemTotal in 6.6.x versus 5.4.x.
> This is because in 6.6.x the swiotlb is still enabled and consuming about 80M of kernel memory, even though
> the intel iommu has been fully initialized.
> This change will cause the swiotlb to be disabled / memory to be released ( via swiotlb_exit ).
> Thanks,
> Adrian
>
>
> From 27e63e727f23189e9c98d81fb445141f998c0808 Mon Sep 17 00:00:00 2001
> From: Adrian Mardare<amardare@cisco.com>
> Date: Sat, 25 Jan 2025 23:41:31 -0500
> Subject: [PATCH] Make intel iommu disable swiotlb
>
> On boards where intel iommu has been successfully
> initialized, we need to disable the swiotlb as there
> is no reason for swiotlb to be active past that.
>
> Signed-off-by: Adrian Mardare<amardare@cisco.com>
> ---
> drivers/iommu/intel/iommu.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index cc46098f875b..971023d33a70 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -3166,6 +3166,9 @@ int __init intel_iommu_init(void)
> pr_info("Intel(R) Virtualization Technology for Directed I/O\n");
>
> intel_iommu_enabled = 1;
> +#ifdef CONFIG_SWIOTLB
> + x86_swiotlb_enable = false;
> +#endif
Why does an iommu driver need to care about swiotlb? The extra memory
consumption might be a problem, but I don't think it should be fixed in
the iommu driver.
Thanks,
baolu
next prev parent reply other threads:[~2025-02-05 10:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-26 5:09 Make intel iommu disable swiotlb Adrian Mardare (amardare)
2025-01-27 16:53 ` Robin Murphy
2025-02-05 10:35 ` Baolu Lu [this message]
2025-02-05 15:49 ` Christoph Hellwig
2025-02-05 16:31 ` Adrian Mardare (amardare)
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=8b2e868e-2b0d-49dc-b703-4e33138a03b4@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=amardare@cisco.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.