linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shivank Garg <shivankgarg98@gmail.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	 akpm@linux-foundation.org, gregkh@linuxfoundation.org,
	 sergey.senozhatsky@gmail.com, pmladek@suse.com
Subject: Is there a different memory allocation path other than the buddy allocator?
Date: Wed, 28 Apr 2021 13:07:50 +0530	[thread overview]
Message-ID: <CAOVCmzEAMz4NGF3gi4O_tNUQfm2+-8AkGiOn0gPN+p3GHctkKA@mail.gmail.com> (raw)

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


             reply	other threads:[~2021-04-28  7:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28  7:37 Shivank Garg [this message]
2021-04-28 14:44 ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOVCmzEAMz4NGF3gi4O_tNUQfm2+-8AkGiOn0gPN+p3GHctkKA@mail.gmail.com \
    --to=shivankgarg98@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pmladek@suse.com \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox