From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: sfxload / asfxload page allocation failure Date: Tue, 13 Apr 2004 19:00:51 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <200404131237.11198.holborn@telefonica.net> <200404131722.52087.holborn@telefonica.net> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: multipart/mixed; boundary="Multipart_Tue_Apr_13_19:00:51_2004-1" Return-path: In-Reply-To: <200404131722.52087.holborn@telefonica.net> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: holborn@telefonica.net Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org --Multipart_Tue_Apr_13_19:00:51_2004-1 Content-Type: text/plain; charset=US-ASCII 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 --Multipart_Tue_Apr_13_19:00:51_2004-1 Content-Type: text/plain; charset=US-ASCII 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; } --Multipart_Tue_Apr_13_19:00:51_2004-1-- ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click