Re: [RFC PATCH v2 0/4] mm, memory_hotplug: allocate memmap from hotadded memory

From: Michal Hocko
Date: Tue Feb 12 2019 - 09:42:49 EST


On Tue 12-02-19 14:56:58, Oscar Salvador wrote:
> On Tue, Feb 12, 2019 at 01:21:38PM +0000, Shameerali Kolothum Thodi wrote:
> > > Hi Oscar,
> > >
> > > I ran tests on one of our arm64 machines. Particular machine doesn't actually
> > > have
> > > the mechanics for hotplug, so was all 'faked', but software wise it's all the
> > > same.
> > >
> > > Upshot, seems to work as expected on arm64 as well.
> > > Tested-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
>
> Thanks Jonathan for having given it a spin, much appreciated!
> I was short of arm64 machines.
>
> > (qemu) object_add memory-backend-ram,id=mem1,size=1G
> > (qemu) device_add pc-dimm,id=dimm1,memdev=mem1,node=1
> > root@ubuntu:~#
> > root@ubuntu:~# numactl -H
> ...
> > node 1 cpus:
> > node 1 size: 1008 MB
> > node 1 free: 1008 MB
> > node distances:
> > node 0 1
> > 0: 10 20
> > 1: 20 10
> > root@ubuntu:~#
>
> Ok, this is what I wanted to see.
> When you hotplugged 1GB, 16MB out of 1024MB were spent
> for the memmap array, that is why you only see 1008MB there.
>
> I am not sure what is the default section size for arm64, but assuming
> is 128MB, that would make sense as 1GB would mean 8 sections,
> and each section takes 2MB.
>
> That means that at least the mechanism works.

Please make sure to test on a larger machine which has multi section
memblocks. This is where I was hitting on bugs hard.
--
Michal Hocko
SUSE Labs