On 04/25/2019 01:18 AM, Pavel Tatashin wrote:
On Wed, Apr 24, 2019 at 5:07 AM Anshuman Khandual
> On 04/24/2019 02:08 AM, Pavel Tatashin wrote:
>> sparsemem section size determines the maximum size and alignment that
>> is allowed to offline/online memory block. The bigger the size the less
>> the clutter in /sys/devices/system/memory/*. On the other hand, however,
>> there is less flexability in what granules of memory can be added and
> Is there any scenario where less than a 1GB needs to be added on arm64 ?
Yes, DAX hotplug loses 1G of memory without allowing smaller sections.
Machines on which we are going to be using this functionality have 8G
of System RAM, therefore losing 1G is a big problem.
For details about using scenario see this cover letter:
Its loosing 1GB because devdax has 2M alignment ? IIRC from Dan's subsection memory
hot add series 2M comes from persistent memory HW controller's limitations. Does that
limitation applicable across all platforms including arm64 for all possible persistent
memory vendors. I mean is it universal ? IIUC subsection memory hot plug series is
still getting reviewed. Hence should not we wait for it to get merged before enabling
applicable platforms to accommodate these 2M limitations.
>> Recently, it was enabled in Linux to hotadd persistent memory that
>> can be either real NV device, or reserved from regular System RAM
>> and has identity of devdax.
> devdax (even ZONE_DEVICE) support has not been enabled on arm64 yet.
Correct, I use your patches to enable ZONE_DEVICE, and thus devdax on ARM64:
>> The problem is that because ARM64's section size is 1G, and devdax must
>> have 2M label section, the first 1G is always missed when device is
>> attached, because it is not 1G aligned.
> devdax has to be 2M aligned ? Does Linux enforce that right now ?
Unfortunately, there is no way around this. Part of the memory can be
reserved as persistent memory via device tree.
device_type = "memory";
reg = < 0x00000000 0x40000000
0x00000002 0x00000000 >;
compatible = "pmem-region";
reg = <0x00000001 0xc0000000
numa-node-id = <0>;
So, while pmem is section aligned, as it should be, the dax device is
going to be pmem start address + label size, which is 2M. The actual
Forgive my ignorance here but why dax device label size is 2M aligned. Again is that
because of some persistent memory HW controller limitations ?
DAX device starts at:
0x1c0000000 + 2M.
Because section size is 1G, the hotplug will able to add only memory
0x1c0000000 + 1G
Got it but as mentioned before we will have to make sure that 2M alignment requirement
is universal else we will be adjusting this multiple times.
> 27 and 28 do not even compile for ARM64_64_PAGES because of MAX_ORDER and
> SECTION_SIZE mismatch.
Even with 27 bits its 128 MB section size. How does it solve the problem with 2M ?
The patch just wanted to reduce the memory wastage ?
Can you please elaborate what configs are you using? I have no
problems compiling with 27 and 28 bit.
After applying your patch  on current mainline kernel .
It fails with
In file included from ./include/linux/gfp.h:6,
./include/linux/mmzone.h:1095:2: error: #error Allocator MAX_ORDER exceeds SECTION_SIZE
#error Allocator MAX_ORDER exceeds SECTION_SIZE