linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hao Lee <haolee.swjtu@gmail.com>
To: linux-mm@kvack.org
Subject: Why the kernel needs `split_mem_range` to split the physical address range?
Date: Sun, 1 Apr 2018 15:01:13 +0800	[thread overview]
Message-ID: <CA+PpKPnOn9GLSfHUCNPSqLQUs0ySN_oCLDmBA_KG59iEpcS71Q@mail.gmail.com> (raw)

Hi,

I'm currently studying the memory management subsystem. When I read
the code of x86_64 memory mapping initialization, I encounter a
problem and can't find answers on Google.

I wonder why the kernel needs `split_mem_range()`[0] to split physical
address range. To make this question clear, I find an example from
dmesg. The arguments of `split_mem_range` are start=0x00100000,
end=0x80000000. The splitting result is:

[mem 0x00100000-0x001FFFFF] page 4k
[mem 0x00200000-0x7FFFFFFF] page 2M

I don't know why the first 1MiB range is separated out to use 4k page
frame. I think these two ranges can be merged and let the range
[0x00100000-0x7FFFFFFF] use 2M page frame completely. I can't
understand the purpose of this range splitting. Could someone please
explain this function to me? Many Thanks!

[0] https://github.com/torvalds/linux/blob/10b84daddbec72c6b440216a69de9a9605127f7a/arch/x86/mm/init.c#L325

Regards,
Hao Lee

             reply	other threads:[~2018-04-01  7:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-01  7:01 Hao Lee [this message]
2018-04-01 13:06 ` Matthew Wilcox
2018-04-02 11:25   ` Hao Lee

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=CA+PpKPnOn9GLSfHUCNPSqLQUs0ySN_oCLDmBA_KG59iEpcS71Q@mail.gmail.com \
    --to=haolee.swjtu@gmail.com \
    --cc=linux-mm@kvack.org \
    /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