"Cannot allocate memory" problem with latest CVS
Hi,
The 'cannot allocate memory' problem has returned on my machine:
$ aplay /usr/lib/sounds/ring.wav Playing WAVE '/usr/lib/sounds/ring.wav' : Unsigned 8 bit, Rate 22050 Hz, Mono ALSA lib pcm_hw.c:297:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed: Cannot allocate memory aplay: set_params:814: Unable to install hw params: ACCESS: RW_INTERLEAVED FORMAT: U8 SUBFORMAT: STD SAMPLE_BITS: 8 FRAME_BITS: 8 CHANNELS: 1 RATE: 22050 PERIOD_TIME: 100000 PERIOD_SIZE: 2205 PERIOD_BYTES: 2205 PERIODS: 5 BUFFER_TIME: 500000 BUFFER_SIZE: 11025 BUFFER_BYTES: 11025 TICK_TIME: 10000
$ aplay /usr/lib/sounds/jungle_exit.wav Playing WAVE '/usr/lib/sounds/jungle_exit.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo ALSA lib pcm_hw.c:297:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed: Cannot allocate memory aplay: set_params:814: Unable to install hw params: ACCESS: RW_INTERLEAVED FORMAT: S16_LE SUBFORMAT: STD SAMPLE_BITS: 16 FRAME_BITS: 32 CHANNELS: 2 RATE: 22050 PERIOD_TIME: 100000 PERIOD_SIZE: 2205 PERIOD_BYTES: 8820 PERIODS: 5 BUFFER_TIME: 500000 BUFFER_SIZE: 11025 BUFFER_BYTES: 44100 TICK_TIME: 10000
$ aplay /usr/lib/sounds/star_trek_6_overture.au Playing Sparc Audio '/usr/lib/sounds/star_trek_6_overture.au' : Mu-Law, Rate 8000 Hz, Mono ALSA lib pcm_hw.c:297:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS failed: Cannot allocate memory aplay: set_params:814: Unable to install hw params: ACCESS: RW_INTERLEAVED FORMAT: MU_LAW SUBFORMAT: STD SAMPLE_BITS: 8 FRAME_BITS: 8 CHANNELS: 1 RATE: 8000 PERIOD_TIME: 125000 PERIOD_SIZE: 1000 PERIOD_BYTES: 1000 PERIODS: 4 BUFFER_TIME: 500000 BUFFER_SIZE: 4000 BUFFER_BYTES: 4000 TICK_TIME: 10000
$ free -t
total used free shared
buffers cached
Mem: 1033544 1020348 13196 0
30228 748684
-/+ buffers/cache: 241436 792108
Swap: 498004 10668 487336
Total: 1531548 1031016 500532$ vmstat procs memory swap io system cpu r b w swpd free buff cache si so bi bo in cs us sy id 2 0 0 10668 13096 30284 748728 0 0 1 3 10 14 97 3 0
I am using the snd-emu10k1 driver with a SB-Live! card, on a 2.4.19-SMP box with 1 GB memory, so this out-of-memory error is a bit of a mystery. Are there any other statistics that would be useful? I expect (hope!) that this error will disappear soon, so I'd recommend a swift response, if required.
Cheers,
Chris
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in Las Vegas (supported by COMDEX), the only Apache event to be fully supported by the ASF. http://www.apachecon.com
Hi,
At Sun, 27 Oct 2002 18:05:41 +0000 (GMT),
Quoted 6 lines · Chris Rankin
Hi,
The 'cannot allocate memory' problem has returned on my machine:
(snip)
Quoted 20 lines
$ free -t total used free shared buffers cached Mem: 1033544 1020348 13196 0 30228 748684 -/+ buffers/cache: 241436 792108 Swap: 498004 10668 487336 Total: 1531548 1031016 500532$ vmstat procs memory swap io system cpu r b w swpd free buff cache si so bi bo in cs us sy id 2 0 0 10668 13096 30284 748728 0 0 1 3 10 14 97 3 0
Quoted 6 lines
I am using the snd-emu10k1 driver with a SB-Live! card, on a 2.4.19-SMP box with 1 GB memory, so this out-of-memory error is a bit of a mystery. Are there any other statistics that would be useful? I expect (hope!) that this error will disappear soon, so I'd recommend a swift response, if required.
i guess actually your box has no free space "for the sb live card". the emu10k1 chip requires the 29bit PCI DMA mask, and it cannot use the whole 1GB memory. hence, even if you have memory on the high-mem region, still this problem may happen.
please note that the current emu10k1 driver allocates pages dynamically at each pcm playback, while the older version grabbed the large contiguous area at the module loading time. this makes the difference of behavior as you found before.
this problem could be solved by using get_free_page() with GFP_KERNEL (without ATOMIC) like on 2.2 kernels, since pci_alloc_consistent() uses always GFP_ATOMIC flag so that it can be called from interrupt handlers. but it would be really a hack...
Takashi
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Ouch. This means that this problem will always appear eventually, and the only way to clear it is waiting for Linux to free a large amount of cache memory. <flamebait>Or I could reboot my machine.</flamebait>
In the meantime, I have no PCM playback via my SB-Live!. Is this a 2.4 or a SB-Live limitation?
Chris
--- Takashi Iwai <[email protected]> wrote: > Hi,
Quoted 72 lines
At Sun, 27 Oct 2002 18:05:41 +0000 (GMT),
Quoted 4 lines · Chris Rankin
Hi,
The 'cannot allocate memory' problem has returned
on
Quoted 2 lines
my machine:
(snip)
Quoted 3 lines
$ free -t total used freeshared
Quoted 2 lines
buffers cached
Mem: 1033544 1020348 131960
Quoted 11 lines
30228 748684
-/+ buffers/cache: 241436 792108 Swap: 498004 10668 487336 Total: 1531548 1031016 500532$ vmstat procs memory swapio system cpu
r b w swpd free buff cache si sobi
Quoted 2 lines
bo in cs us sy id
2 0 0 10668 13096 30284 748728 0 01
Quoted 5 lines
3 10 14 97 3 0
I am using the snd-emu10k1 driver with a SB-Live!
card, on a 2.4.19-SMP box with 1 GB memory, sothis
Quoted 1 line
out-of-memory error is a bit of a mystery. Are
there
Quoted 1 line
any other statistics that would be useful? I
expect
Quoted 1 line
(hope!) that this error will disappear soon, so
I'd
Quoted 1 line
recommend a swift response, if required.
i guess actually your box has no free space "for the sb live card".
the emu10k1 chip requires the 29bit PCI DMA mask, and it cannot use
the whole 1GB memory. hence, even if you have memory on the high-mem
region, still this problem may happen.please note that the current emu10k1 driver
allocates pages
dynamically at each pcm playback, while the older
version grabbed the
large contiguous area at the module loading time.
this makes the
difference of behavior as you found before.this problem could be solved by using
get_free_page()withGFP_KERNEL
(without ATOMIC) like on 2.2 kernels, sincepci_alloc_consistent()
uses alwaysGFP_ATOMICflag so that it can be called from interrupt
handlers. but it would be really a hack...
Quoted 1 line
Takashi
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven.
http://thinkgeek.com/sf
At Mon, 28 Oct 2002 13:21:48 +0000 (GMT),
Quoted 5 lines · Chris Rankin
Ouch. This means that this problem will always appear eventually, and the only way to clear it is waiting for Linux to free a large amount of cache memory. <flamebait>Or I could reboot my machine.</flamebait>
could you try the attached patch?
as mentioned in my previous mail, this is really a hack, but if it works...
Quoted 2 lines
In the meantime, I have no PCM playback via my SB-Live!. Is this a 2.4 or a SB-Live limitation?
both :)
Takashi
--- Takashi Iwai <[email protected]> wrote: > At Mon, 28
Oct 2002 13:21:48 +0000 (GMT),
Quoted 4 lines
could you try the attached patch?
as mentioned in my previous mail, this is really a hack, but if it
works...
My box has obviously released some memory overnight and is working again. I'll try the patch as soon as the problem reoccurs.
Cheers,
Chris
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven.
http://thinkgeek.com/sf