Re: [PATCH 4/6] x86, mm: make split_mem_range() more easy to read

Wei Yang
2019-04-12T03:08:41Z

On Sun, Mar 24, 2019 at 03:29:04PM +0100, Thomas Gleixner wrote:

>Find a mostly untested patch which implements this below. I just booted it
>in a 64bit guest and it did not explode.
>
>It removes 55 lines of code instead of adding 35 and reduces the binary
>size by 408 bytes on 64bit and 128 bytes on 32bit.
>
>Note, it's a combo of changes (including your patch 1/6) and needs to be
>split up. It would be nice if you have time to split it up into separate
>patches, add proper changelogs and test the heck out of it on both 32 and
>64 bit. If you don't have time, please let me know.

I tried to test mem hotplug with this applied.

On x86_64, this looks good. It split ranges well. While I found some problem
on testing mem hotplug on x86_32.

I start up a guest memory and trying to plug 1G memory.

The original memory split range looks good:

[ 0.004260] ywtest: [mem 0x00000000-0x00100000]
[ 0.004261] ywtest: [mem 0x00000000-0x000fffff] page size 4k
[ 0.004268] ywtest: [mem 0x37200000-0x37400000]
[ 0.004269] ywtest: [mem 0x37200000-0x373fffff] page size 2M
[ 0.004271] ywtest: [mem 0x20000000-0x37200000]
[ 0.004272] ywtest: [mem 0x20000000-0x371fffff] page size 2M
[ 0.004280] ywtest: [mem 0x00100000-0x20000000]
[ 0.004281] ywtest: [mem 0x00100000-0x001fffff] page size 4k
[ 0.004281] ywtest: [mem 0x00200000-0x1fffffff] page size 2M
[ 0.004292] ywtest: [mem 0x37400000-0x375fe000]
[ 0.004293] ywtest: [mem 0x37400000-0x375fdfff] page size 4k

While I can't online the new added memory device. And the new memory device's
range is out of 4G, which is a little bit strange.

>
>Thanks,
>
> tglx
>
--
Wei Yang
Help you, Help me