linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
To: h-kanigeri2@ti.com
Cc: x0095840@ti.com, ameya.palande@nokia.com, nm@ti.com,
	grgupta@ti.com, linux-omap@vger.kernel.org,
	Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Subject: [PATCH 1/1] DSPBRIDGE: Set __GFP_RECLAIMABLE for reloading bridge module
Date: Thu, 19 Mar 2009 11:37:56 +0200	[thread overview]
Message-ID: <1237455476-29196-1-git-send-email-Hiroshi.DOYU@nokia.com> (raw)

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


             reply	other threads:[~2009-03-19  9:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19  9:37 Hiroshi DOYU [this message]
2009-03-19 12:34 ` [PATCH 1/1] DSPBRIDGE: Set __GFP_RECLAIMABLE for reloading bridge module Menon, Nishanth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1237455476-29196-1-git-send-email-Hiroshi.DOYU@nokia.com \
    --to=hiroshi.doyu@nokia.com \
    --cc=ameya.palande@nokia.com \
    --cc=grgupta@ti.com \
    --cc=h-kanigeri2@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=x0095840@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).