[ofa-general] [PATCH] Change memory allocation for cqp request to GFP_ATOMIC

Don Wood donald.e.wood at intel.com
Thu Jul 23 15:00:36 PDT 2009


The routine to allocate a cqp request is not called from process context code.
Since it is not ok to sleep, it needs to be GFP_ATOMIC not GFP_KERNEL.

Signed-off-by: Don Wood <donald.e.wood at intel.com>
---
 drivers/infiniband/hw/nes/nes_utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index a282031..b34072b 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -548,7 +548,7 @@ struct nes_cqp_request *nes_get_cqp_request(struct nes_device *nesdev)
 		spin_unlock_irqrestore(&nesdev->cqp.lock, flags);
 	}
 	if (cqp_request == NULL) {
-		cqp_request = kzalloc(sizeof(struct nes_cqp_request), GFP_KERNEL);
+		cqp_request = kzalloc(sizeof(struct nes_cqp_request), GFP_ATOMIC);
 		if (cqp_request) {
 			cqp_request->dynamic = 1;
 			INIT_LIST_HEAD(&cqp_request->list);
-- 
1.6.0




More information about the general mailing list