IOMMU Archive on
 help / color / Atom feed
* [PATCH AUTOSEL 4.9 40/60] iommu/amd: Silence warnings under memory pressure
       [not found] <>
@ 2019-09-22 18:59 ` Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2019-09-22 18:59 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Sasha Levin, iommu, Joerg Roedel

From: Qian Cai <>

[ Upstream commit 3d708895325b78506e8daf00ef31549476e8586a ]

When running heavy memory pressure workloads, the system is throwing
endless warnings,

smartpqi 0000:23:00.0: AMD-Vi: IOMMU mapping error in map_sg (io-pages:
5 reason: -12)
Hardware name: HPE ProLiant DL385 Gen10/ProLiant DL385 Gen10, BIOS A40
swapper/10: page allocation failure: order:0, mode:0xa20(GFP_ATOMIC),
Call Trace:
 pqi_raid_submit_scsi_cmd_with_io_request+0x1c3/0x470 [smartpqi]

because the allocation could fail from iommu_map_page(), and the volume
of this call could be huge which may generate a lot of serial console
output and cosumes all CPUs.

Fix it by silencing the warning in this call site, and there is still a
dev_err() later to notify the failure.

Signed-off-by: Qian Cai <>
Signed-off-by: Joerg Roedel <>
Signed-off-by: Sasha Levin <>
 drivers/iommu/amd_iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index c1233d0288a03..245e831fe64c3 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2589,7 +2589,9 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
 			bus_addr  = address + s->dma_address + (j << PAGE_SHIFT);
 			phys_addr = (sg_phys(s) & PAGE_MASK) + (j << PAGE_SHIFT);
-			ret = iommu_map_page(domain, bus_addr, phys_addr, PAGE_SIZE, prot, GFP_ATOMIC);
+			ret = iommu_map_page(domain, bus_addr, phys_addr,
+					     PAGE_SIZE, prot,
+					     GFP_ATOMIC | __GFP_NOWARN);
 			if (ret)
 				goto out_unmap;

iommu mailing list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <>
2019-09-22 18:59 ` [PATCH AUTOSEL 4.9 40/60] iommu/amd: Silence warnings under memory pressure Sasha Levin

IOMMU Archive on

Archives are clonable:
	git clone --mirror linux-iommu/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iommu linux-iommu/ \
	public-inbox-index linux-iommu

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone