From: Peter Zijlstra <peterz@infradead.org>
To: Cliffe <cliffe@ii.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Out of memory error
Date: Sat, 31 Jan 2009 14:48:40 +0100 [thread overview]
Message-ID: <1233409720.4787.9.camel@laptop> (raw)
In-Reply-To: <49846071.1020809@ii.net>
On Sat, 2009-01-31 at 22:30 +0800, Cliffe wrote:
> > Its simply a case of you using kmalloc(GFP_ATOMIC) and that's failing.
> >
>
> So it has nothing to do with stack size because we are talking heap?
> What could be causing the problem?
Right, heap. The thing is, Linux has a greedy memory usage, and tries to
keep as much as possible in memory, this means that we're basically in a
constant state of low memory.
Regular allocations (GFP_KERNEL) can sleep, and can therefore reclaim
memory (write out stuff dirty to disk, swap a little, etc..).
Your allocation (GFP_ATOMIC) isn't allowed to sleep, and can therefore
not reclaim memory -- if it really hits rock bottom, not uncommon, it
just fails to provide memory.
Any code using GFP_ATOMIC (or for that matter, any kernel allocation,
GFP_KERNEL can fail too, just not as easy) must be able to deal with
allocation failures.
How to do that is very domain specific.
> How limited is the stack?
Depends on the arch and build details, 4k is a reasonable assumption.
> > Furthermore, it appears to me you're not using frame pointers for your
> > kernel builds, please ammend that, it gives far more readable output.
> >
>
> I'll look into that. Is that a kernel compile config option?
CONFIG_FRAME_POINTER=y
next prev parent reply other threads:[~2009-01-31 13:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m2eiz06iav.fsf@ssh.synack.fr>
[not found] ` <200901291025.36076.paul.moore@hp.com>
[not found] ` <1233267347.13812.22.camel@sp-laptop3.sp-local>
[not found] ` <200901291738.36148.paul.moore@hp.com>
[not found] ` <1233275267.13812.31.camel@sp-laptop3.sp-local>
[not found] ` <m2ocxpzhs2.fsf@ssh.synack.fr>
2009-01-31 13:17 ` Out of memory error Cliffe
2009-01-31 12:58 ` Peter Zijlstra
[not found] ` <49846071.1020809@ii.net>
2009-01-31 13:48 ` Peter Zijlstra [this message]
2011-03-28 19:56 Out of Memory Error Gus Zernial
2011-03-29 1:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-03-29 21:38 ` Gus Zernial
2011-03-30 1:00 ` Jordan Uggla
2011-03-30 13:27 ` Gus Zernial
2011-03-30 21:15 ` Lennart Sorensen
2011-03-31 6:35 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-04-07 0:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-03-29 21:48 ` richardvoigt
2011-03-30 0:50 ` Phillip Susi
2011-03-30 1:13 ` richardvoigt
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=1233409720.4787.9.camel@laptop \
--to=peterz@infradead.org \
--cc=cliffe@ii.net \
--cc=linux-kernel@vger.kernel.org \
/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.