kernel memory usage any restrictions?
hello,
Quoted 4 lines · --- Chris Friesen
Quoted 3 lines · cranium2003 wrote:
hello,
Is there any restricition on using
kernel's memory? also if i require to use some
Quoted 9 lines
kernel
Quoted 1 line
memory say 625kB by allocating that in
GFP_ATOMICmode
Your call will almost certainly fail. I think kmalloc will only give
you up to 128KB, and even that might be tricky to do withGFP_ATOMIC.
NO I mean the source code total require 625kB
not i require a single call of kmalloc with GFP_ATOMIC but many calls whose total sum will be around 625kB.
Quoted 6 lines
For larger chunks of memory, you can use
vmalloc()or reserve it
statically at compile time.Chris
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Quoted 8 lines · On Fri, 2005-05-27 at 18:56 -0700, cranium2003 wrote:
Quoted 5 lines
Your call will almost certainly fail. I think kmalloc will only give
you up to 128KB, and even that might be tricky to do withGFP_ATOMIC.NO I mean the source code total require 625kB
not i require a single call of kmalloc withGFP_ATOMICbut many calls whose total sum will be around 625kB.
Matters what you system is. I have a gig of RAM and can easily allocate a meg by 32 32K chunks. I haven't tried it with ATOMIC, but that just means it will fail if it can't get you something right away and it needs to sleep. But if you keep trying, that is, don't allocate then (assuming you're in an interrupt) and try again another time (in another interrupt), you should eventually get the 625kB. But as this answer is, you need to supply more context. If you can't fail any of those tries, then it probably won't work. You're system may be cached out, and would need to write pages to the disk before it can give you the memory you need, and then it would have to sleep.
-- Steve