From: Takashi Iwai <tiwai@suse.de>
To: holborn@telefonica.net
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: sfxload / asfxload page allocation failure
Date: Tue, 13 Apr 2004 19:00:51 +0200 [thread overview]
Message-ID: <s5hbrlvvmm4.wl@alsa2.suse.de> (raw)
In-Reply-To: <200404131722.52087.holborn@telefonica.net>
[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]
At Tue, 13 Apr 2004 17:22:52 +0100,
holborn wrote:
>
> On Martes 13 Abril 2004 16:27, Takashi Iwai wrote:
> > At Tue, 13 Apr 2004 12:37:10 +0100,
> >
>
> >
> > well, it means that your machine has really no RAM available for the
> > soundfont. on 2.4 kernel (or older ALSA version), the driver
> > allocated the pages in atomic, so it doesn't go to sleep.
> > on 2.6 and current ALSA, the page allocation is done with GFP_KERNEL,
> > so it may sleep until the page is available. it can take a long time
> > but must not be infinitely long.
> >
> > could you check whether the "page allocation failure" message already
> > appeared when sfxload hangs up?
> > does the message appears once or many times?
> >
> >
>
> Hi ... the message appears after reboot command ...
> I have load this soundfonts for years :-)
> No problems to load the soundfont in kernel 2.6.4 alsa 1.0.2c but still no
> load in 2.6.5, i checked in two machines gentoo and Debian ..
>
>
> I made the sfxload after booting ...
>
>
> free command after login is:
>
> Mem total 515728 used 37940 free 477788 ----> in kernel 2.6.5
> Mem total 515728 used 38916 free 476824 ----> in kernel 2.6.4
hmm, then it shouldn't fail.
i guess the attached patch fixes the problem. please give a try.
Takashi
[-- Attachment #2: Type: text/plain, Size: 1399 bytes --]
Index: alsa-kernel/core/memalloc.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/core/memalloc.c,v
retrieving revision 1.30
diff -u -r1.30 memalloc.c
--- alsa-kernel/core/memalloc.c 7 Apr 2004 17:49:39 -0000 1.30
+++ alsa-kernel/core/memalloc.c 13 Apr 2004 16:58:05 -0000
@@ -137,14 +137,17 @@
dma_addr_t *dma_handle, int flags)
{
void *ret;
- u64 dma_mask;
+ u64 dma_mask, coherent_dma_mask;
if (dev == NULL || !dev->dma_mask)
return dma_alloc_coherent(dev, size, dma_handle, flags);
dma_mask = *dev->dma_mask;
+ coherent_dma_mask = dev->coherent_dma_mask;
*dev->dma_mask = 0xffffffff; /* do without masking */
+ dev->coherent_dma_mask = 0xffffffff; /* do without masking */
ret = dma_alloc_coherent(dev, size, dma_handle, flags);
*dev->dma_mask = dma_mask; /* restore */
+ dev->coherent_dma_mask = coherent_dma_mask; /* restore */
if (ret) {
/* obtained address is out of range? */
if (((unsigned long)*dma_handle + size - 1) & ~dma_mask) {
@@ -154,8 +157,12 @@
}
} else {
/* wish to success now with the proper mask... */
- if (dma_mask != 0xffffffffUL)
+ if (dma_mask != 0xffffffffUL) {
+ /* allocation with GFP_ATOMIC to avoid the long stall */
+ flags &= ~GFP_KERNEL;
+ flags |= GFP_ATOMIC;
ret = dma_alloc_coherent(dev, size, dma_handle, flags);
+ }
}
return ret;
}
next prev parent reply other threads:[~2004-04-13 17:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-13 11:37 sfxload / asfxload page allocation failure holborn
2004-04-13 15:27 ` Takashi Iwai
2004-04-13 16:22 ` holborn
2004-04-13 17:00 ` Takashi Iwai [this message]
2004-04-14 1:25 ` holborn
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=s5hbrlvvmm4.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=holborn@telefonica.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.