On Mon, Jan 20, 2020 at 6:08 AM Aneesh Kumar K.V
<[email protected]> wrote:
>
> Kernel should validate the namespace size against SUBSECTION_SIZE rather than
> PAGE_SIZE. blk namespace continues to use old rule so that the new kernel 
> don't
> break the creation of blk namespaces.
>
> Use the new helper arch_namespace_align_size() so that architecture specific
> restrictions are also taken care of.
>
> kernel log will contain the below details
> [  939.620064] nd namespace0.3: 1071644672 is not 16384K aligned

This can't be enforced at size_store() time because the size is only
invalid relative to whether someone wants to create more namespaces or
assign a personality. Instead the free space allocation code needs to
pick the correct alignment by default, and it needs to assume that the
boot-to-boot physical address alignment variation is something greater
than memremap_compat_align(). For x86 it's typically 64MiB, do you
happen to know if Power firmware would ever physically remap a
resource range in a way that would violate that 16MiB minimum
alignment guarantee?

If we have that guarantee then the new kernel enabling needed is a way
to adjust the free-space allocator to align new allocations to
memremap_compat_align(), but that ndctl would likely bump that up to
16MiB across the board since it knows that Power needs more alignment
than x86 and it is the agent that wants to enforce cross-arch
compatibility. Otherwise the kernel should do it's best to support
requested size_store().
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to