[openib-general] [PATCH] mthca: save low memory used for reserved objects

Michael S. Tsirkin mst at mellanox.co.il
Thu Dec 14 04:46:29 PST 2006


We never need to allocate memory for reserved objects in low memory.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

---

I noticed this obvious optimization when going over the icm allocation code.

Index: linux-2.6/drivers/infiniband/hw/mthca/mthca_memfree.c
===================================================================
--- linux-2.6.orig/drivers/infiniband/hw/mthca/mthca_memfree.c
+++ linux-2.6/drivers/infiniband/hw/mthca/mthca_memfree.c
@@ -313,8 +313,7 @@ struct mthca_icm_table *mthca_alloc_icm_
 			chunk_size = nobj * obj_size - i * MTHCA_TABLE_CHUNK_SIZE;
 
 		table->icm[i] = mthca_alloc_icm(dev, chunk_size >> PAGE_SHIFT,
-						(use_lowmem ? GFP_KERNEL : GFP_HIGHUSER) |
-						__GFP_NOWARN);
+						 GFP_HIGHUSER | __GFP_NOWARN);
 		if (!table->icm[i])
 			goto err;
 		if (mthca_MAP_ICM(dev, table->icm[i], virt + i * MTHCA_TABLE_CHUNK_SIZE,

-- 
MST




More information about the general mailing list