linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] DSPBRIDGE: Set __GFP_RECLAIMABLE for reloading bridge module
@ 2009-03-19  9:37 Hiroshi DOYU
  2009-03-19 12:34 ` Menon, Nishanth
  0 siblings, 1 reply; 2+ messages in thread
From: Hiroshi DOYU @ 2009-03-19  9:37 UTC (permalink / raw)
  To: h-kanigeri2
  Cc: x0095840, ameya.palande, nm, grgupta, linux-omap, 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.DOYU@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-19 12:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-19  9:37 [PATCH 1/1] DSPBRIDGE: Set __GFP_RECLAIMABLE for reloading bridge module Hiroshi DOYU
2009-03-19 12:34 ` Menon, Nishanth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).