[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bootmem allocator



Disclaimer: I have ignored the bootmem allocator
thus far, but I presume it works very much like
the old 2.2 bootmem allocation code, so I'll
try to answer your questions on that basis... but
maybe I'll be wrong :-)

A. Supreeth Reddy wrote:

> Hi All,
> 
> I am trying to understand how the bootmem allocator is designed. I have the
> following questions in the bootmem allocator.
> 
> 1. Does it give memory in a sequential fashion in terms of pages or does it
> allow any allocation of powers of 2 ?

Sequentially; you ask for a particular number of pages
and you get the lowest-address available free pages.

 
> 2. Is only 1/8 th of the whole memory after "_end" given to bootmem
> allocator, since in init_bootmem_core () there is something like
> 		mapsize = (( end - start) + 7)/8;

The bootmem map is a bitmap, so 1 bit/page, not
1 byte/page.

> 3. Does the function __alloc_bootmem_alloc () try to concatenate 2
> subsequent allocations to avoid internal fragmentation ?

I expect so.

 
> 4. And what is the purpose of last_offset and last_pos fields in the
> bootmem_data_t structure, I find that they are used only in
> __alloc_bootmem_alloc () function.
> 

This may be something involving NUMA.

> Thanks in advance,
> regards,
> Supreeth.

Sorry if I lead you astray; I'll take a look at this
later today and try to get an outline up on my web
site.

-- Joe

-- Joseph Knapka
"If I ever get reincarnated... let me make certain I don't come back
  as a paperclip." -- protagonist, H Murakami's "Hard-boiled Wonderland"
// Linux MM Documentation in progress:
// http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
* Evolution is an "unproven theory" in the same sense that gravity is. *

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/