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
prev parent reply other threads:[~2009-01-31 13:48 UTC|newest]
Thread overview: 3+ 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]
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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox