public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wei Yang <richardw.yang@linux.intel.com>
To: x86@kernel.org, linux-kernel@vger.kernel.org
Cc: richard.weiyang@gmail.com, dave.hansen@linux.intel.com,
	luto@kernel.org, peterz@infradead.or, tglx@linutronix.de,
	Wei Yang <richardw.yang@linux.intel.com>
Subject: [Patch v2 0/6] Refactor split_mem_range with proper helper and loop
Date: Thu,  5 Dec 2019 10:13:57 +0800	[thread overview]
Message-ID: <20191205021403.25606-1-richardw.yang@linux.intel.com> (raw)

split_mem_range is used to prepare range before mapping kernel page table.

After first version, Thomas suggested some brilliant idea to re-write the
logic.

Wei split the big patch into pieces and did some tests.  To verify the
functionality, Wei abstract the code into userland and did following test
cases:
    
        * ranges fits only 4K
        * ranges fits only 2M
        * ranges fits only 1G
        * ranges fits 4K and 2M
        * ranges fits 2M and 1G
        * ranges fits 4K, 2M and 1G
        * ranges fits 4K, 2M and 1G but w/o 1G size
        * ranges fits 4K, 2M and 1G with only 4K size
    
    Below is the test result:
    
        ### Split [4K, 16K][0x00001000-0x00004000]:
        [mem 0x00001000-0x00003fff] page size 4K
        ### Split [4M, 64M][0x00400000-0x04000000]:
        [mem 0x00400000-0x03ffffff] page size 2M
        ### Split [0G, 2G][0000000000-0x80000000]:
        [mem 0000000000-0x7fffffff] page size 1G
        ### Split [16K, 4M + 16K][0x00004000-0x00404000]:
        [mem 0x00004000-0x001fffff] page size 4K
        [mem 0x00200000-0x003fffff] page size 2M
        [mem 0x00400000-0x00403fff] page size 4K
        ### Split [4M, 2G + 2M][0x00400000-0x80200000]:
        [mem 0x00400000-0x3fffffff] page size 2M
        [mem 0x40000000-0x7fffffff] page size 1G
        [mem 0x80000000-0x801fffff] page size 2M
        ### Split [4M - 16K, 2G + 2M + 16K][0x003fc000-0x80204000]:
        [mem 0x003fc000-0x003fffff] page size 4K
        [mem 0x00400000-0x3fffffff] page size 2M
        [mem 0x40000000-0x7fffffff] page size 1G
        [mem 0x80000000-0x801fffff] page size 2M
        [mem 0x80200000-0x80203fff] page size 4K
        ### Split w/o 1G size [4M - 16K, 2G + 2M + 16K][0x003fc000-0x80204000]:
        [mem 0x003fc000-0x003fffff] page size 4K
        [mem 0x00400000-0x801fffff] page size 2M
        [mem 0x80200000-0x80203fff] page size 4K
        ### Split w/ only 4K [4M - 16K, 2G + 2M + 16K][0x003fc000-0x80204000]:
        [mem 0x003fc000-0x80203fff] page size 4K

Thomas Gleixner (1):
  x86/mm: Refactor split_mem_range with proper helper and loop

Wei Yang (5):
  x86/mm: Remove second argument of split_mem_range()
  x86/mm: Add attribute __ro_after_init to after_bootmem
  x86/mm: Make page_size_mask unsigned int clearly
  x86/mm: Refine debug print string retrieval function
  x86/mm: Use address directly in split_mem_range()

 arch/x86/mm/init.c | 259 ++++++++++++++++++---------------------------
 1 file changed, 103 insertions(+), 156 deletions(-)

-- 
2.17.1


             reply	other threads:[~2019-12-05  2:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05  2:13 Wei Yang [this message]
2019-12-05  2:13 ` [Patch v2 1/6] x86/mm: Remove second argument of split_mem_range() Wei Yang
2019-12-05  2:13 ` [Patch v2 2/6] x86/mm: Add attribute __ro_after_init to after_bootmem Wei Yang
2019-12-05  2:14 ` [Patch v2 3/6] x86/mm: Make page_size_mask unsigned int clearly Wei Yang
2019-12-05  2:14 ` [Patch v2 4/6] x86/mm: Refine debug print string retrieval function Wei Yang
2019-12-05  9:13   ` Peter Zijlstra
2019-12-06  1:51     ` Wei Yang
2019-12-06 10:27       ` Peter Zijlstra
2019-12-06 15:17         ` Wei Yang
2019-12-05  2:14 ` [Patch v2 5/6] x86/mm: Use address directly in split_mem_range() Wei Yang
2019-12-07  3:36   ` kbuild test robot
2019-12-07  7:17     ` Wei Yang
2019-12-05  2:14 ` [Patch v2 6/6] x86/mm: Refactor split_mem_range with proper helper and loop Wei Yang

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=20191205021403.25606-1-richardw.yang@linux.intel.com \
    --to=richardw.yang@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.or \
    --cc=richard.weiyang@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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