linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* __alloc_pages: 4-order allocation failed
@ 2001-07-02 16:59 Ho Chak Hung
  2001-07-05 21:25 ` Jes Sorensen
  0 siblings, 1 reply; 16+ messages in thread
From: Ho Chak Hung @ 2001-07-02 16:59 UTC (permalink / raw)
  To: linux-kernel

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/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-07-02 16:59 __alloc_pages: 4-order allocation failed Ho Chak Hung
@ 2001-07-05 21:25 ` Jes Sorensen
  0 siblings, 0 replies; 16+ messages in thread
From: Jes Sorensen @ 2001-07-05 21:25 UTC (permalink / raw)
  To: Ho Chak Hung; +Cc: linux-kernel

>>>>> "Ho" == Ho Chak Hung <hunghochak@netscape.net> 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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
@ 2001-07-06  0:33 David Whysong
  2001-07-06  0:23 ` Marcelo Tosatti
  0 siblings, 1 reply; 16+ messages in thread
From: David Whysong @ 2001-07-06  0:33 UTC (permalink / raw)
  To: linux-kernel

Jes Sorensen (jes@sunsite.dk) 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                                       dwhysong@physics.ucsb.edu
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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-07-06  0:33 David Whysong
@ 2001-07-06  0:23 ` Marcelo Tosatti
  0 siblings, 0 replies; 16+ messages in thread
From: Marcelo Tosatti @ 2001-07-06  0:23 UTC (permalink / raw)
  To: David Whysong; +Cc: linux-kernel



On Thu, 5 Jul 2001, David Whysong wrote:

> Jes Sorensen (jes@sunsite.dk) 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) 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26  6:15 ` Jeff V. Merkey
  2001-04-26  8:57   ` Mike Galbraith
@ 2001-04-26 18:00   ` Szabolcs Szakacsits
  2001-04-26 17:33     ` Jeff V. Merkey
  1 sibling, 1 reply; 16+ messages in thread
From: Szabolcs Szakacsits @ 2001-04-26 18:00 UTC (permalink / raw)
  To: Jeff V. Merkey; +Cc: Feng Xian, linux-kernel, Feng Xian


On Thu, 26 Apr 2001, Jeff V. Merkey wrote:

> I am seeing this as well on 2.4.3 with both _get_free_pages() and
> kmalloc().  In the kmalloc case, the modules hang waiting
> for memory.

One possible source of this hang is due to the change below in
2.4.3, non GPF_ATOMIC and non-recursive allocations (PF_MEMALLOC is set)
will loop until the requested continuous memory is available.

	Szaka

diff -u --recursive --new-file v2.4.2/linux/mm/page_alloc.c
linux/mm/page_alloc.c--- v2.4.2/linux/mm/page_alloc.c        Sat Feb  3
19:51:32 2001
+++ linux/mm/page_alloc.c       Tue Mar 20 15:05:46 2001
@@ -455,8 +455,7 @@
                        memory_pressure++;
                        try_to_free_pages(gfp_mask);
                        wakeup_bdflush(0);
-                       if (!order)
-                               goto try_again;
+                       goto try_again;
                }
        }


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26 18:00   ` Szabolcs Szakacsits
@ 2001-04-26 17:33     ` Jeff V. Merkey
  0 siblings, 0 replies; 16+ messages in thread
From: Jeff V. Merkey @ 2001-04-26 17:33 UTC (permalink / raw)
  To: Szabolcs Szakacsits; +Cc: Feng Xian, linux-kernel, Feng Xian

On Thu, Apr 26, 2001 at 08:00:12PM +0200, Szabolcs Szakacsits wrote:
> 
> On Thu, 26 Apr 2001, Jeff V. Merkey wrote:

The request should fail after two or three attempts rather than hang
the entire system waiting for memory.

Jeff

> 
> > I am seeing this as well on 2.4.3 with both _get_free_pages() and
> > kmalloc().  In the kmalloc case, the modules hang waiting
> > for memory.
> 
> One possible source of this hang is due to the change below in
> 2.4.3, non GPF_ATOMIC and non-recursive allocations (PF_MEMALLOC is set)
> will loop until the requested continuous memory is available.
> 
> 	Szaka
> 
> diff -u --recursive --new-file v2.4.2/linux/mm/page_alloc.c
> linux/mm/page_alloc.c--- v2.4.2/linux/mm/page_alloc.c        Sat Feb  3
> 19:51:32 2001
> +++ linux/mm/page_alloc.c       Tue Mar 20 15:05:46 2001
> @@ -455,8 +455,7 @@
>                         memory_pressure++;
>                         try_to_free_pages(gfp_mask);
>                         wakeup_bdflush(0);
> -                       if (!order)
> -                               goto try_again;
> +                       goto try_again;
>                 }
>         }
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26 13:50       ` Feng Xian
  2001-04-26 13:53         ` Andi Kleen
@ 2001-04-26 13:56         ` Feng Xian
  1 sibling, 0 replies; 16+ messages in thread
From: Feng Xian @ 2001-04-26 13:56 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Marcelo Tosatti, linux-kernel, Feng Xian


The problem is I didn't see those error message on 2.4.2 or 2.4.0, only on
2.4.3. That's the reason I posted the question here. Maybe I will try
2.4.4

Thanks all for you guys!

Alex

On Thu, 26 Apr 2001, Feng Xian wrote:

>
> Yes I am running nvidia module. i tried nv, X use less memory but nv
> doesn't give me the NV_GLX extension, xlock will crash for some 3d mode.
>
> Alex
>
> On Thu, 26 Apr 2001, Andi Kleen wrote:
>
> > On Thu, Apr 26, 2001 at 08:09:06AM -0400, Feng Xian wrote:
> > > It looks like the X consumes most of the memory (almost used up all the
> > > physical memory, more than 100M), it uses NVidia driver. I was also
> > > running pppoe but that took less memory.
> >
> > You're probably using the NVidia provided driver module, right?
> > Try it without it and the "nv" driver.
> >
> >
> > -Andi
> >
>
>

-- 
 Feng Xian
     .-.
     /v\    L   I   N   U   X
    // \\  >Phear the Penguin<
   /(   )\
    ^^-^^


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26 13:50       ` Feng Xian
@ 2001-04-26 13:53         ` Andi Kleen
  2001-04-26 13:56         ` Feng Xian
  1 sibling, 0 replies; 16+ messages in thread
From: Andi Kleen @ 2001-04-26 13:53 UTC (permalink / raw)
  To: Feng Xian; +Cc: Andi Kleen, Marcelo Tosatti, linux-kernel, Feng Xian

On Thu, Apr 26, 2001 at 09:50:15AM -0400, Feng Xian wrote:
> 
> Yes I am running nvidia module. i tried nv, X use less memory but nv
> doesn't give me the NV_GLX extension, xlock will crash for some 3d mode.

In this case you should report any kernel problems you see to NVidia
first, except if you can also reproduce them without the nvidia module.

-Andi

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26 12:30     ` Andi Kleen
@ 2001-04-26 13:50       ` Feng Xian
  2001-04-26 13:53         ` Andi Kleen
  2001-04-26 13:56         ` Feng Xian
  0 siblings, 2 replies; 16+ messages in thread
From: Feng Xian @ 2001-04-26 13:50 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Marcelo Tosatti, linux-kernel, Feng Xian


Yes I am running nvidia module. i tried nv, X use less memory but nv
doesn't give me the NV_GLX extension, xlock will crash for some 3d mode.

Alex

On Thu, 26 Apr 2001, Andi Kleen wrote:

> On Thu, Apr 26, 2001 at 08:09:06AM -0400, Feng Xian wrote:
> > It looks like the X consumes most of the memory (almost used up all the
> > physical memory, more than 100M), it uses NVidia driver. I was also
> > running pppoe but that took less memory.
>
> You're probably using the NVidia provided driver module, right?
> Try it without it and the "nv" driver.
>
>
> -Andi
>

-- 
 Feng Xian
     .-.
     /v\    L   I   N   U   X
    // \\  >Phear the Penguin<
   /(   )\
    ^^-^^


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26 12:09   ` Feng Xian
@ 2001-04-26 12:30     ` Andi Kleen
  2001-04-26 13:50       ` Feng Xian
  0 siblings, 1 reply; 16+ messages in thread
From: Andi Kleen @ 2001-04-26 12:30 UTC (permalink / raw)
  To: Feng Xian; +Cc: Marcelo Tosatti, linux-kernel, Feng Xian

On Thu, Apr 26, 2001 at 08:09:06AM -0400, Feng Xian wrote:
> It looks like the X consumes most of the memory (almost used up all the
> physical memory, more than 100M), it uses NVidia driver. I was also
> running pppoe but that took less memory.

You're probably using the NVidia provided driver module, right?
Try it without it and the "nv" driver.


-Andi 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
       [not found] <Pine.LNX.4.10.10104252238590.3810-100000@coffee.psychology.mcmaster.ca>
@ 2001-04-26 12:11 ` Feng Xian
  0 siblings, 0 replies; 16+ messages in thread
From: Feng Xian @ 2001-04-26 12:11 UTC (permalink / raw)
  To: Mark Hahn; +Cc: linux-kernel

Thanks for the suggestion. but where to get pre-2.4.4 kernel? when I
looked into the kernel traffic mail list, peoples are talking about 2.4.4,
but i checked kernel.org, the lastest one i found is 2.4.3

regards,

Alex


On Wed, 25 Apr 2001, Mark Hahn wrote:

> > I am running linux-2.4.3 on a Dell dual PIII machine with 128M memory.
>
> 2.4.3 has many known flaws; why not try a pre-2.4.4 kernel?
>
> > __alloc_pages: 4-order allocation failed.
>
> these happen when someone tries to allocate large contiguous blocks.
>
> > and sometime the system will crash. I looked into the memory info,
> > there still has some free physical memory (20M) left and swap space is
> > almost not in use. (250M swap)
>
> your ram is fragmented; it's the contiguity that is causing the failure.
>
> > I didn't have this problem when I ran 2.4.0 (I even didn't see it on
> > 2.4.2) could anybody tell me what's wrong or where should I look into this
> > problem?
>
> you can simply perturb ram (flush, etc), or use a newer kernel.
>

-- 
 Feng Xian
     .-.
     /v\    L   I   N   U   X
    // \\
   /(   )\
    ^^-^^


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26  1:48 ` Marcelo Tosatti
@ 2001-04-26 12:09   ` Feng Xian
  2001-04-26 12:30     ` Andi Kleen
  0 siblings, 1 reply; 16+ messages in thread
From: Feng Xian @ 2001-04-26 12:09 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-kernel, Feng Xian

On Wed, 25 Apr 2001, Marcelo Tosatti wrote:

>
>
> On Wed, 25 Apr 2001, Feng Xian wrote:
>
> > Hi,
> >
> > I am running linux-2.4.3 on a Dell dual PIII machine with 128M memory.
> > After the machine runs a while, dmesg shows,
> >
> > __alloc_pages: 4-order allocation failed.
> > __alloc_pages: 3-order allocation failed.
> > __alloc_pages: 4-order allocation failed.
> > __alloc_pages: 4-order allocation failed.
> > __alloc_pages: 4-order allocation failed.
> > __alloc_pages: 4-order allocation failed.
> >
> >
> > and sometime the system will crash. I looked into the memory info,
> > there still has some free physical memory (20M) left and swap space is
> > almost not in use. (250M swap)
> >
> > I didn't have this problem when I ran 2.4.0 (I even didn't see it on
> > 2.4.2) could anybody tell me what's wrong or where should I look into this
> > problem?
>
> Feng,
>
> Which apps are you running when this happens ?

It looks like the X consumes most of the memory (almost used up all the
physical memory, more than 100M), it uses NVidia driver. I was also
running pppoe but that took less memory.

>
> Thanks
>
>

-- 
 Feng Xian


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26  6:15 ` Jeff V. Merkey
@ 2001-04-26  8:57   ` Mike Galbraith
  2001-04-26 18:00   ` Szabolcs Szakacsits
  1 sibling, 0 replies; 16+ messages in thread
From: Mike Galbraith @ 2001-04-26  8:57 UTC (permalink / raw)
  To: Jeff V. Merkey; +Cc: linux-kernel

On Thu, 26 Apr 2001, Jeff V. Merkey wrote:

> I am seeing this as well on 2.4.3 with both _get_free_pages() and
> kmalloc().  In the kmalloc case, the modules hang waiting
> for memory.

Would adding __builtin_return_address(0) to the warning help locate?

	-Mike


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26  1:09 Feng Xian
  2001-04-26  1:48 ` Marcelo Tosatti
@ 2001-04-26  6:15 ` Jeff V. Merkey
  2001-04-26  8:57   ` Mike Galbraith
  2001-04-26 18:00   ` Szabolcs Szakacsits
  1 sibling, 2 replies; 16+ messages in thread
From: Jeff V. Merkey @ 2001-04-26  6:15 UTC (permalink / raw)
  To: Feng Xian; +Cc: linux-kernel, Feng Xian



I am seeing this as well on 2.4.3 with both _get_free_pages() and 
kmalloc().  In the kmalloc case, the modules hang waiting
for memory.

Jeff

On Wed, Apr 25, 2001 at 09:09:57PM -0400, Feng Xian wrote:
> Hi,
> 
> I am running linux-2.4.3 on a Dell dual PIII machine with 128M memory.
> After the machine runs a while, dmesg shows,
> 
> __alloc_pages: 4-order allocation failed.
> __alloc_pages: 3-order allocation failed.
> __alloc_pages: 4-order allocation failed.
> __alloc_pages: 4-order allocation failed.
> __alloc_pages: 4-order allocation failed.
> __alloc_pages: 4-order allocation failed.
> 
> 
> and sometime the system will crash. I looked into the memory info,
> there still has some free physical memory (20M) left and swap space is
> almost not in use. (250M swap)
> 
> I didn't have this problem when I ran 2.4.0 (I even didn't see it on
> 2.4.2) could anybody tell me what's wrong or where should I look into this
> problem?
> 
> Thanks,
> 
> Alex
> 
> -- 
> Feng Xian
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: __alloc_pages: 4-order allocation failed
  2001-04-26  1:09 Feng Xian
@ 2001-04-26  1:48 ` Marcelo Tosatti
  2001-04-26 12:09   ` Feng Xian
  2001-04-26  6:15 ` Jeff V. Merkey
  1 sibling, 1 reply; 16+ messages in thread
From: Marcelo Tosatti @ 2001-04-26  1:48 UTC (permalink / raw)
  To: Feng Xian; +Cc: linux-kernel, Feng Xian



On Wed, 25 Apr 2001, Feng Xian wrote:

> Hi,
> 
> I am running linux-2.4.3 on a Dell dual PIII machine with 128M memory.
> After the machine runs a while, dmesg shows,
> 
> __alloc_pages: 4-order allocation failed.
> __alloc_pages: 3-order allocation failed.
> __alloc_pages: 4-order allocation failed.
> __alloc_pages: 4-order allocation failed.
> __alloc_pages: 4-order allocation failed.
> __alloc_pages: 4-order allocation failed.
> 
> 
> and sometime the system will crash. I looked into the memory info,
> there still has some free physical memory (20M) left and swap space is
> almost not in use. (250M swap)
> 
> I didn't have this problem when I ran 2.4.0 (I even didn't see it on
> 2.4.2) could anybody tell me what's wrong or where should I look into this
> problem?

Feng,

Which apps are you running when this happens ?

Thanks 



^ permalink raw reply	[flat|nested] 16+ messages in thread

* __alloc_pages: 4-order allocation failed
@ 2001-04-26  1:09 Feng Xian
  2001-04-26  1:48 ` Marcelo Tosatti
  2001-04-26  6:15 ` Jeff V. Merkey
  0 siblings, 2 replies; 16+ messages in thread
From: Feng Xian @ 2001-04-26  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Feng Xian

Hi,

I am running linux-2.4.3 on a Dell dual PIII machine with 128M memory.
After the machine runs a while, dmesg shows,

__alloc_pages: 4-order allocation failed.
__alloc_pages: 3-order allocation failed.
__alloc_pages: 4-order allocation failed.
__alloc_pages: 4-order allocation failed.
__alloc_pages: 4-order allocation failed.
__alloc_pages: 4-order allocation failed.


and sometime the system will crash. I looked into the memory info,
there still has some free physical memory (20M) left and swap space is
almost not in use. (250M swap)

I didn't have this problem when I ran 2.4.0 (I even didn't see it on
2.4.2) could anybody tell me what's wrong or where should I look into this
problem?

Thanks,

Alex

-- 
Feng Xian


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2001-07-06  1:56 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-02 16:59 __alloc_pages: 4-order allocation failed Ho Chak Hung
2001-07-05 21:25 ` Jes Sorensen
  -- strict thread matches above, loose matches on Subject: below --
2001-07-06  0:33 David Whysong
2001-07-06  0:23 ` Marcelo Tosatti
     [not found] <Pine.LNX.4.10.10104252238590.3810-100000@coffee.psychology.mcmaster.ca>
2001-04-26 12:11 ` Feng Xian
2001-04-26  1:09 Feng Xian
2001-04-26  1:48 ` Marcelo Tosatti
2001-04-26 12:09   ` Feng Xian
2001-04-26 12:30     ` Andi Kleen
2001-04-26 13:50       ` Feng Xian
2001-04-26 13:53         ` Andi Kleen
2001-04-26 13:56         ` Feng Xian
2001-04-26  6:15 ` Jeff V. Merkey
2001-04-26  8:57   ` Mike Galbraith
2001-04-26 18:00   ` Szabolcs Szakacsits
2001-04-26 17:33     ` Jeff V. Merkey

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).