Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12241

How does Linux buddy allocator determine which size order list to insert into when freeing block?

$
0
0

The Binary Buddy Allocator used in Linux uses bitmaps where each bit corresponds to a state of a pair of buddy-blocks (taken from this article). And the void free_page(void *addr) call doesn't take a size of the allocated block that is to be freed.

I don't understand how this algorithm does determine into which order list to insert a block being freed without knowing its size. Let's imagine we allocated all available memory, so all the bitmaps are zeroed. Now we call free_page() with some address, and it's not clear into which list should the block be inserted.


Viewing all articles
Browse latest Browse all 12241

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>