RE: [PATCH 1/1] DSPBRIDGE: Set __GFP_RECLAIMABLE for reloading bridge module

2009-03-19 Thread Menon, Nishanth
 -Original Message-
 From: Hiroshi DOYU [mailto:hiroshi.d...@nokia.com]
 Sent: Thursday, March 19, 2009 11:38 AM
 To: Kanigeri, Hari
 Cc: Guzman Lugo, Fernando; ameya.pala...@nokia.com; Menon, Nishanth;
 Gupta, Ramesh; linux-omap@vger.kernel.org; Hiroshi DOYU
 Subject: [PATCH 1/1] DSPBRIDGE: Set __GFP_RECLAIMABLE for reloading bridge
 module
 
 To restart DSP system after DSP crash, reloading bridge module is
 necessary and a high order page allocation may fail after long use
 time because of memory fragmentation. To avoid this, mark it as
 reclaimable for immediate reloading.
 
 Signed-off-by: Hiroshi DOYU hiroshi.d...@nokia.com
Thanks Hiroshi.

Tested-by: Nishanth Menon n...@ti.com

Test h/w: SDP3430. - OMAP3430 ES3.0

Test iteration:
insmod  ./bridgedriver.ko shm_size=0x40 phys_mempool_base=0 
base_img=/lib/dsp/baseimage.dof
rmmod bridgedriver
--

Num iterations: 25K

Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/1] DSPBRIDGE: Set __GFP_RECLAIMABLE for reloading bridge module

2009-03-19 Thread Hiroshi DOYU
To restart DSP system after DSP crash, reloading bridge module is
necessary and a high order page allocation may fail after long use
time because of memory fragmentation. To avoid this, mark it as
reclaimable for immediate reloading.

Signed-off-by: Hiroshi DOYU hiroshi.d...@nokia.com
---
 drivers/dsp/bridge/services/mem.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/dsp/bridge/services/mem.c 
b/drivers/dsp/bridge/services/mem.c
index 0a10304..3661fb1 100644
--- a/drivers/dsp/bridge/services/mem.c
+++ b/drivers/dsp/bridge/services/mem.c
@@ -357,9 +357,14 @@ void *MEM_AllocPhysMem(u32 cBytes, u32 ulAlign, OUT u32 
*pPhysicalAddress)
if (extPhysMemPoolEnabled) {
pVaMem = MEM_ExtPhysMemAlloc(cBytes, ulAlign,
(u32 *)paMem);
-   } else
-   pVaMem = dma_alloc_coherent(NULL, cBytes, paMem,
-  (in_atomic()) ? GFP_ATOMIC : 
GFP_KERNEL);
+   } else {
+   gfp_t gfp = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;
+
+   /* To ensure allocation at immediate reloading */
+   gfp |= __GFP_RECLAIMABLE;
+
+   pVaMem = dma_alloc_coherent(NULL, cBytes, paMem, gfp);
+   }
if (pVaMem == NULL) {
*pPhysicalAddress = 0;
GT_1trace(MEM_debugMask, GT_6CLASS,
-- 
1.5.6.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html