linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Hao Lee <haolee.swjtu@gmail.com>
Cc: linux-mm@kvack.org
Subject: Re: Why the kernel needs `split_mem_range` to split the physical address range?
Date: Sun, 1 Apr 2018 06:06:07 -0700	[thread overview]
Message-ID: <20180401130607.GG13332@bombadil.infradead.org> (raw)
In-Reply-To: <CA+PpKPnOn9GLSfHUCNPSqLQUs0ySN_oCLDmBA_KG59iEpcS71Q@mail.gmail.com>

On Sun, Apr 01, 2018 at 03:01:13PM +0800, Hao Lee wrote:
> 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!

2MB pages have to be 2MB aligned.  If you want to use the memory between
1MB and 2MB, but not the memory between 0MB and 1MB, you must split the
first 2MB range into 4kB pages.

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-01  7:01 Hao Lee
2018-04-01 13:06 ` Matthew Wilcox [this message]
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=20180401130607.GG13332@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=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