DSPBRIDGE: Set __GFP_RECLAIMABLE for reloading bridge module
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.
--- drivers/dsp/bridge/services/mem.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
drivers/dsp/bridge/services/mem.c +8 -3
@@ -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,
Signature · 1 line
1.5.6.3
Quoted 9 lines
-----Original Message-----
From: Hiroshi DOYU [mailto:[email protected]]
Sent: Thursday, March 19, 2009 11:38 AM
To: Kanigeri, Hari
Cc: Guzman Lugo, Fernando; [email protected]; Menon, Nishanth; Gupta, Ramesh; [email protected]; Hiroshi DOYU
Subject: [PATCH 1/1] DSPBRIDGE: Set__GFP_RECLAIMABLEfor reloading bridge module
Quoted 6 lines
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 <[email protected]>
Thanks Hiroshi.
Test h/w: SDP3430. - OMAP3430 ES3.0
Test iteration:
insmod ./bridgedriver.ko shm_size=0x400000 phys_mempool_base=0 base_img=/lib/dsp/baseimage.dof rmmod bridgedriver
--
Num iterations: 25K
Regards,
Nishanth Menon