2001-07-02 17:00:20

by hunghochak

[permalink] [raw]
Subject: __alloc_pages: 4-order allocation failed

Hi,

I got the error __alloc_pages: 4-order allocation failed in a module that uses and frees a lot of pages.
Basically, I am trying implement a page cache for the module. First, I keep allocating pages using page_cache_alloc() until it fails, then I free a whole bunch of pages using freepages((unsigned long)page_address(page))

Would anyone please give me some advice about how to solve this problem?
Thanks a lot.

__________________________________________________________________
Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/


2001-07-05 21:25:37

by Jes Sorensen

[permalink] [raw]
Subject: Re: __alloc_pages: 4-order allocation failed

>>>>> "Ho" == Ho Chak Hung <[email protected]> writes:

Ho> Hi, I got the error __alloc_pages: 4-order allocation failed in a
Ho> module that uses and frees a lot of pages. Basically, I am trying
Ho> implement a page cache for the module. First, I keep allocating
Ho> pages using page_cache_alloc() until it fails, then I free a whole
Ho> bunch of pages using freepages((unsigned long)page_address(page))

Ho> Would anyone please give me some advice about how to solve this
Ho> problem? Thanks a lot.

You ran out of memory, ie. there were no more free blocks of 16
consecutive pages available in the system. This is what happens on a
system with little memory or which is loaded with memory intensive
applications.

Jes

2001-07-06 00:33:58

by David Whysong

[permalink] [raw]
Subject: Re: __alloc_pages: 4-order allocation failed

Jes Sorensen ([email protected]) wrote:

>You ran out of memory, ie. there were no more free blocks of 16
>consecutive pages available in the system. This is what happens on a
>system with little memory or which is loaded with memory intensive
>applications.

I'm seeing the same thing here on a machine with 256 MB RAM and 1.5
gigabytes of swap. There is no chance I am using anywhere near that
much virtual memory.

Something is wrong with the MM in 2.4.6-pre9.

Dave

David Whysong [email protected]
Astrophysics graduate student University of California, Santa Barbara
My public PGP keys are on my web page - http://www.physics.ucsb.edu/~dwhysong
DSS PGP Key 0x903F5BD6 : FE78 91FE 4508 106F 7C88 1706 B792 6995 903F 5BD6
D-H PGP key 0x5DAB0F91 : BC33 0F36 FCCD E72C 441F 663A 72ED 7FB7 5DAB 0F91

2001-07-06 01:56:28

by Marcelo Tosatti

[permalink] [raw]
Subject: Re: __alloc_pages: 4-order allocation failed



On Thu, 5 Jul 2001, David Whysong wrote:

> Jes Sorensen ([email protected]) wrote:
>
> >You ran out of memory, ie. there were no more free blocks of 16
> >consecutive pages available in the system. This is what happens on a
> >system with little memory or which is loaded with memory intensive
> >applications.
>
> I'm seeing the same thing here on a machine with 256 MB RAM and 1.5
> gigabytes of swap. There is no chance I am using anywhere near that
> much virtual memory.
>
> Something is wrong with the MM in 2.4.6-pre9.

David,

The messages are "harmless". The SCSI layer is trying to allocate big
chunks of memory (for the scattergather tables IIRC) just as an
optimization.

If its not possible to allocate big chunks, the SCSI code will use lower
order allocations. (smaller chunks)