Skip to contentSkip to conversation

scsi: qedf: use GFP_ATOMIC to prevent vmalloc allocation panic

PATCH In review Nimal Prabudoss I 2 participants 2 messages May 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: qedf: use GFP_ATOMIC to prevent vmalloc allocation panic

The qedf driver encounters an exc_invalid_op crash in get_vm_area_node when running under intensive I/O stress with IOMMU enabled.

---
 drivers/scsi/qedf/qedf_io.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/qedf/qedf_io.c +4 -4
index a120f0e37a64..6883aaf683bd 100644
@@ -2059,7 +2059,7 @@ int qedf_init_mp_req(struct qedf_ioreq *io_req)
 		mp_req->req_len = io_req->data_xfer_len;
 
 	mp_req->req_buf = dma_alloc_coherent(&qedf->pdev->dev, QEDF_PAGE_SIZE,
-	    &mp_req->req_buf_dma, GFP_KERNEL);
+	    &mp_req->req_buf_dma, GFP_ATOMIC);
 	if (!mp_req->req_buf) {
 		QEDF_ERR(&(qedf->dbg_ctx), "Unable to alloc MP req buffer\n");
 		qedf_free_mp_resc(io_req);
@@ -2067,7 +2067,7 @@ int qedf_init_mp_req(struct qedf_ioreq *io_req)
 	}
 
 	mp_req->resp_buf = dma_alloc_coherent(&qedf->pdev->dev,
-	    QEDF_PAGE_SIZE, &mp_req->resp_buf_dma, GFP_KERNEL);
+	    QEDF_PAGE_SIZE, &mp_req->resp_buf_dma, GFP_ATOMIC);
 	if (!mp_req->resp_buf) {
 		QEDF_ERR(&(qedf->dbg_ctx), "Unable to alloc TM resp "
 			  "buffer\n");
@@ -2078,7 +2078,7 @@ int qedf_init_mp_req(struct qedf_ioreq *io_req)
 	/* Allocate and map mp_req_bd and mp_resp_bd */
 	sz = sizeof(struct scsi_sge);
 	mp_req->mp_req_bd = dma_alloc_coherent(&qedf->pdev->dev, sz,
-	    &mp_req->mp_req_bd_dma, GFP_KERNEL);
+	    &mp_req->mp_req_bd_dma, GFP_ATOMIC);
 	if (!mp_req->mp_req_bd) {
 		QEDF_ERR(&(qedf->dbg_ctx), "Unable to alloc MP req bd\n");
 		qedf_free_mp_resc(io_req);
@@ -2086,7 +2086,7 @@ int qedf_init_mp_req(struct qedf_ioreq *io_req)
 	}
 
 	mp_req->mp_resp_bd = dma_alloc_coherent(&qedf->pdev->dev, sz,
-	    &mp_req->mp_resp_bd_dma, GFP_KERNEL);
+	    &mp_req->mp_resp_bd_dma, GFP_ATOMIC);
 	if (!mp_req->mp_resp_bd) {
 		QEDF_ERR(&(qedf->dbg_ctx), "Unable to alloc MP resp bd\n");
 		qedf_free_mp_resc(io_req);
Signature · 1 line
2.54.0
#1 lore raw
Quoted 4 lines · Nimal Prabudoss I

The qedf driver encounters an exc_invalid_op crash in get_vm_area_node when running under intensive I/O stress with IOMMU enabled.

This is not accessible without a Jira account.
I'd suggest to drop the link and expand the commit message to explain why it crashed.

Maurizio

Quoted 45 lines
---
 drivers/scsi/qedf/qedf_io.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/qedf/qedf_io.c +4 -4
index a120f0e37a64..6883aaf683bd 100644
@@ -2059,7 +2059,7 @@ int qedf_init_mp_req(struct qedf_ioreq *io_req)
 		mp_req->req_len = io_req->data_xfer_len;
 
 	mp_req->req_buf = dma_alloc_coherent(&qedf->pdev->dev, QEDF_PAGE_SIZE,
-	    &mp_req->req_buf_dma, GFP_KERNEL);
+	    &mp_req->req_buf_dma, GFP_ATOMIC);
 	if (!mp_req->req_buf) {
 		QEDF_ERR(&(qedf->dbg_ctx), "Unable to alloc MP req buffer\n");
 		qedf_free_mp_resc(io_req);
@@ -2067,7 +2067,7 @@ int qedf_init_mp_req(struct qedf_ioreq *io_req)
 	}
 
 	mp_req->resp_buf = dma_alloc_coherent(&qedf->pdev->dev,
-	    QEDF_PAGE_SIZE, &mp_req->resp_buf_dma, GFP_KERNEL);
+	    QEDF_PAGE_SIZE, &mp_req->resp_buf_dma, GFP_ATOMIC);
 	if (!mp_req->resp_buf) {
 		QEDF_ERR(&(qedf->dbg_ctx), "Unable to alloc TM resp "
 			  "buffer\n");
@@ -2078,7 +2078,7 @@ int qedf_init_mp_req(struct qedf_ioreq *io_req)
 	/* Allocate and map mp_req_bd and mp_resp_bd */
 	sz = sizeof(struct scsi_sge);
 	mp_req->mp_req_bd = dma_alloc_coherent(&qedf->pdev->dev, sz,
-	    &mp_req->mp_req_bd_dma, GFP_KERNEL);
+	    &mp_req->mp_req_bd_dma, GFP_ATOMIC);
 	if (!mp_req->mp_req_bd) {
 		QEDF_ERR(&(qedf->dbg_ctx), "Unable to alloc MP req bd\n");
 		qedf_free_mp_resc(io_req);
@@ -2086,7 +2086,7 @@ int qedf_init_mp_req(struct qedf_ioreq *io_req)
 	}
 
 	mp_req->mp_resp_bd = dma_alloc_coherent(&qedf->pdev->dev, sz,
-	    &mp_req->mp_resp_bd_dma, GFP_KERNEL);
+	    &mp_req->mp_resp_bd_dma, GFP_ATOMIC);
 	if (!mp_req->mp_resp_bd) {
 		QEDF_ERR(&(qedf->dbg_ctx), "Unable to alloc MP resp bd\n");
 		qedf_free_mp_resc(io_req);