linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How do you allocate huge pages.
@ 2007-06-19 12:07 Shaun Savage
  2007-06-19 12:38 ` Matthias Kaehlcke
  0 siblings, 1 reply; 3+ messages in thread
From: Shaun Savage @ 2007-06-19 12:07 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi

I am trying to allocate very large memory within the kernel. I want to
start by allocating one huge (4M) page and using that as buffer space.

How do you do this?

shaun

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

* Re: How do you allocate huge pages.
  2007-06-19 12:07 How do you allocate huge pages Shaun Savage
@ 2007-06-19 12:38 ` Matthias Kaehlcke
  2007-06-20  7:32   ` Jiri Slaby
  0 siblings, 1 reply; 3+ messages in thread
From: Matthias Kaehlcke @ 2007-06-19 12:38 UTC (permalink / raw)
  To: Shaun Savage; +Cc: Linux Kernel Mailing List

El Tue, Jun 19, 2007 at 05:07:30AM -0700 Shaun Savage ha dit:
 
> I am trying to allocate very large memory within the kernel. I want to
> start by allocating one huge (4M) page and using that as buffer space.

possibly vmalloc() is what you're looking for, if it isn't really a
*page* of 4M, what afaik is impossible with a standard kernel.

vmalloc() allocates virtually contiguous memory, as opposed to
kmalloc() which allocates physically contiguous memory.

-- 
Matthias Kaehlcke
Linux Application Developer
Barcelona

     La libertad es como la mañana. Hay quienes esperan dormidos a que
   llegue, pero hay quienes desvelan y caminan la noche para alcanzarla
                        (Subcomandante Marcos)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

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

* Re: How do you allocate huge pages.
  2007-06-19 12:38 ` Matthias Kaehlcke
@ 2007-06-20  7:32   ` Jiri Slaby
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2007-06-20  7:32 UTC (permalink / raw)
  To: Matthias Kaehlcke, Shaun Savage, Linux Kernel Mailing List

Matthias Kaehlcke napsal(a):
> El Tue, Jun 19, 2007 at 05:07:30AM -0700 Shaun Savage ha dit:
>  
>> I am trying to allocate very large memory within the kernel. I want to
>> start by allocating one huge (4M) page and using that as buffer space.
> 
> possibly vmalloc() is what you're looking for, if it isn't really a
> *page* of 4M, what afaik is impossible with a standard kernel.

sparc64 can have pages up to 4M in size. This changes nothing in the fact, that
you should use vmalloc for such big spaces. Esp. when you allocate it after some
time from boot, otherwise fragmentation disallows you to alloc physically
contiguous memory due to fragmentation.

regards,
-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

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

end of thread, other threads:[~2007-06-20  7:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-19 12:07 How do you allocate huge pages Shaun Savage
2007-06-19 12:38 ` Matthias Kaehlcke
2007-06-20  7:32   ` Jiri Slaby

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