From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7740258ED5 for ; Fri, 3 Apr 2026 02:28:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775183304; cv=none; b=Cy/gSYam4gl8g+i6BC5d7F6HuC8uQLPQn/qB1b97/1fJ3842JvHFYYKTqb2mhSaVkDL9ScvHrsZeOUQGjxY5oBauAey3jRap8cJ6U/SYDe30VbUKUcmiqo6pF7CE6pc8KXaCfqvSHTAkHQ3BHgaGFv7tOFQFn1lIffMLulhZrUU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775183304; c=relaxed/simple; bh=AYdOen/ZkumBkvzxVN16QDwCr+cFHVnINwn0hlRF9/o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WQhU81Rm8+N7ZzCjMUpopZ3ZQ0EiU45s2CB9g/ODD/SWAg+vqn+0G96Uhj8/5QtYMF/5h9fi1t1d7bWDMS8sFKrAgRNRqUTP1YjvWojJ/zu7b6kqnLH0IVoigQTltNg1S85ZJyPcgt67xJjtuzFhZGPa0wPmhz7pMPODXWxHqPs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=m66qZPAE; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="m66qZPAE" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2b243198058so24015ad.1 for ; Thu, 02 Apr 2026 19:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775183303; x=1775788103; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9F4Hc1NxXYsYxfPtoZfVmSu26aBhFkkTpUXoCZNtth4=; b=m66qZPAEmzeIkPNCDHTA1j2y+WfEaXPM1KtauFOAWXGLzmAGvBY7IZ41fZ0k1uzlRD 6aMrKOY1ysiqN2ap8Y7uVFP8S+dQBhlRNgVmS5N5dPyi7u7sKUafkjC4YUerRPsNTDdT fB7jZrOJ9y/8zawhLEemQ0K2znasrFB4hpQV4SNFjPA3UD8gFTNFFb51cp2ho715bk/y r2GDM05FxptFnxgEU6qBOHWOi4HF/rmid+G2593C4h0U3PU9Xi8IrLcmVn8kaIY+WP+X VQeYzPA/U75wkOZA1+3ukv54mTVl+iAbVthLFIj4G7Ecr39LG5pO2cf52M8JS7q4efEW /9Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775183303; x=1775788103; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9F4Hc1NxXYsYxfPtoZfVmSu26aBhFkkTpUXoCZNtth4=; b=os0xgQvK51zVwYerLZj5Krcntlh6CGsPh5/ybGpsFqsOBsVw9a4BQpLDZ4dhoLucBY 6pcRodfkmJ9icF6gP2aHU8AE3t95sCdW0ZsGe7S5RAlUPtwg4jA74omVBrP5igiiAPgQ QNpuVFwtfTGqcnRDsFPrRgoPKrEZkMiA8v+pg2f+tMjI2WKjgaTsCaoihnY9D1AfUwg0 5+BuHO1kkR67YcZtCWFJKRkw5JFqeaqoU3FjymnKr+SaW+G6/UifBOPwxCylVFbHhO41 41lsG9KPFH7YER6an1i3+B5x3dg3yt+dfRNxIRz50215XQJZh0UrI5HSvjcKWhvaRk0h vUrA== X-Forwarded-Encrypted: i=1; AJvYcCXCxk1L18T8mwAtMVpRcfIvYD310n5akeKFGaXE4Cjl/sBWeIbuvoDqdlbZ8Pm2lBPM8Q5YprYpW6RKijo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1ytGRtd4DgsMMHVYwE1uIA4/Sey6TdznV0zZTrrGSJFdWo7+/ kH4LEuaAi31LRdtY16fG0FxjBdqcfH4VZUG4PpVxBXUGXyqdWixTy3aeQudfGKNmsQ== X-Gm-Gg: AeBDietAnaSXaubDAmtTT3thVKV1xdEVjTbH5JpQpMmS9gq2/LGF9kEvoNVLzlPWeGb o3UXv4X5LEUPM3qxaM2n4ax0pJuxDB25ZjbzUO8VgDhus+qyVXu0N+sTzJmQnaVqgrpxMLdXKpl oQS4Lne4FDMGjM3RDoFznMp9byJZ0LAmjq+t/6p27CYCEhrlMskySZ6r3kwujow8WSwYxvXetAF DxDSC1s2DrvqbcnHvqgt6MgtShuuyugnm3u+LRh44daYewgg7EmE1o+FWfWOXMVNwZiPWmggtSn uHOrlKqRh/MXGrEoNAfr7WgSk4VLT15k3eAEmjHliFRQHmjaLJIAYPf6AmRghzMSIrFlJds66nf NOzD6fhxT8XaWeBCvuLrG+Ak7jo9y2I530/FxRHj/HYFZPgovm16uB4oB2ux3sJUX+scc7Gg3HM D8hzin9rSuH7DMmXGVQBitSwbBomzrsheQNm+ZkTGDjpuJE/1DTjmc3wSSZA== X-Received: by 2002:a17:903:46c4:b0:2b0:5cc5:9405 with SMTP id d9443c01a7336-2b283f04ae8mr724965ad.1.1775183302570; Thu, 02 Apr 2026 19:28:22 -0700 (PDT) Received: from google.com (10.129.124.34.bc.googleusercontent.com. [34.124.129.10]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c76c6475b56sm3991678a12.1.2026.04.02.19.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2026 19:28:22 -0700 (PDT) Date: Fri, 3 Apr 2026 02:28:17 +0000 From: Pranjal Shrivastava To: Nafees Ahmed Abdul Cc: joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] iommu: Default to lazy DMA mode on ARM64 Message-ID: References: <20260402195913.32084-1-nafeabd@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260402195913.32084-1-nafeabd@amazon.com> Hi Nafees, On Thu, Apr 02, 2026 at 07:59:13PM +0000, Nafees Ahmed Abdul wrote: > ARM64 currently falls through to IOMMU_DEFAULT_DMA_STRICT, while > X86 defaults to IOMMU_DEFAULT_DMA_LAZY. On ARM64 bare-metal > systems with the ARM SMMU, strict mode causes synchronous TLBI > + CMD_SYNC on every DMA unmap, resulting in significant > throughput degradation for network-intensive workloads. > > Benchmarked on an ARM64 bare-metal system (AWS m8g.metal-24xl) > running Debian 13 with kernel 6.12.74, using iperf3: > > STRICT (default): 14.9 Gbps > LAZY: 39.8 Gbps > > This is a 2.67x throughput improvement simply by switching the > IOMMU default domain mode. > > Distributions that do not explicitly override this Kconfig > choice (e.g., Debian, SLES) silently get STRICT on ARM64, > causing this regression on bare-metal systems. Changing the > upstream default avoids the need for each distribution to > independently carry this override. > Thanks for the patch and the benchmarks. However, I'm not sure why should we change the compile-time default for all ARM64 systems? Currently, users can already achieve this behavior by using the `iommu.strict=0` boot parameter. Since IOMMU_DEFAULT_DMA_STRICT provides a higher security guarantee (preventing sub-page aliasing and potential "use-after-unmap" attacks), keeping it as the default and allowing users to opt-in via the kernel cmd line seems like the safer path, in my opinion. Additionally, distributions like Debian can also set this via their GRUB configurations for performance. > Add ARM64 to the LAZY default to align with X86 behavior. > > Signed-off-by: Nafees Ahmed Abdul > --- > drivers/iommu/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig > index f86262b11..2822aba75 100644 > --- a/drivers/iommu/Kconfig > +++ b/drivers/iommu/Kconfig > @@ -96,7 +96,7 @@ config IOMMU_DEBUGFS > choice > prompt "IOMMU default domain type" > depends on IOMMU_API > - default IOMMU_DEFAULT_DMA_LAZY if X86 || S390 > + default IOMMU_DEFAULT_DMA_LAZY if X86 || S390 || ARM64 > default IOMMU_DEFAULT_DMA_STRICT > help > Choose the type of IOMMU domain used to manage DMA API usage by Thanks, Praan