Skip to content

Refactor split_mem_range with proper helper and loop

Wei Yang lkml oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 5 repliesIn review
  2. v16 patches 12 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6x86/mm: Remove second argument of split_mem_range()arch/x86/mm/init.c+3 -30 replies
2/6x86/mm: Add attribute __ro_after_init to after_bootmemarch/x86/mm/init.c+1 -10 replies
3/6x86/mm: Make page_size_mask unsigned int clearlyarch/x86/mm/init.c+18 -180 replies
4/6x86/mm: Refine debug print string retrieval functionarch/x86/mm/init.c+13 -264 replies
5/6x86/mm: Use address directly in split_mem_range()arch/x86/mm/init.c+36 -371 reply
6/6x86/mm: Refactor split_mem_range with proper helper and looparch/x86/mm/init.c+93 -1320 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by.

PatchWei Yang
1/6
2/6
3/6
4/6
5/6
6/6T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Patch v2 0/6] Refactor split_mem_range with proper helper and loop

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(-)
Signature · 1 line
2.17.1