Is there a different memory allocation path other than the buddy allocator?

From: Shivank Garg
Date: Wed Apr 28 2021 - 03:38:38 EST


Hi Everyone!

I'm understanding memory allocation in Linux and doing some changes in
buddy allocator (__alloc_pages_nodemask) for my experiments. I create
a new flag in `struct page->flags` (by adding a new flag in `enum
pageflags` in `page-flags.h`. I set this bit permanently in
__alloc_pages_nodemask (to not to be cleared once set and survive all
further allocation and freeing). But I'm not able to see expected
behavior.

I'm guessing this is because Linux is also using some different path
to allocate memory (probably during boot). Is my hypothesis correct?

Is there any different memory allocation path other than buddy
allocator? Where can I find it?

To keep the newly added bit in the page_flag set for 'struct page'
lifetime. I make sure not to clear it while freeing by unsetting it
in "#define PAGE_FLAGS_CHECK_AT_PREP \
- (((1UL << NR_PAGEFLAGS) - 1) & ~__PG_HWPOISON & ~(1UL <<
PG_NEWEXPFLAG))" I know adding new bits in page->flag is probably not
a good idea but this if for better understanding :)

Thank You and stay safe!

Best Regards,
Shivank