[ofa-general] [PATCH ofed-1.3] ehca: change kmem_cache_alloc() call to atomic

Stefan Roscher ossrosch at linux.vnet.ibm.com
Mon Nov 19 06:27:07 PST 2007


This patch fixes a migth_sleep kernel warning with using sdp + ehca device driver.
We have to change the kmem_cache_alloc() attribute from GFP_KERNEL to GFP_ATOMIC because sdp is running within a spinlock
during ah allocation.

regards Stefan

Signed-off-by: Stefan Roscher <stefan.roscher at de.ibm.com>
---

ehca_av.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


diff -Nurp ofa_kernel-1.3_old/drivers/infiniband/hw/ehca/ehca_av.c ofa_kernel-1.3_new/drivers/infiniband/hw/ehca/ehca_av.c
--- ofa_kernel-1.3_old/drivers/infiniband/hw/ehca/ehca_av.c	2007-11-19 14:32:35.000000000 +0100
+++ ofa_kernel-1.3_new/drivers/infiniband/hw/ehca/ehca_av.c	2007-11-19 14:40:16.000000000 +0100
@@ -57,7 +57,7 @@ struct ib_ah *ehca_create_ah(struct ib_p
 	struct ehca_shca *shca = container_of(pd->device, struct ehca_shca,
 					      ib_device);
 
-	av = kmem_cache_alloc(av_cache, GFP_KERNEL);
+	av = kmem_cache_alloc(av_cache, GFP_ATOMIC);
 	if (!av) {
 		ehca_err(pd->device, "Out of memory pd=%p ah_attr=%p",
 			 pd, ah_attr);




More information about the general mailing list