On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V <aneesh.ku...@linux.ibm.com> wrote: [..] > > True, for the pfn device and the device-dax mapping size, but I'm > > suggesting adding another instance of alignment control at the raw > > namespace level. That would need to be disconnected from the > > device-dax page mapping granularity. > > > > Can you explain what you mean by raw namespace level ? We don't have > multiple values against which we need to check the alignment of > namespace start and namespace size. > > If you can outline how and where you would like to enforce that check I > can start working on it. >
What I mean is that the process of setting up a pfn namespace goes something like this in shell script form: 1/ echo $size > /sys/bus/nd/devices/$namespace/size 2/ echo $namespace > /sys/bus/nd/devices/$pfn/namespace 3/ echo $pfn_align > /sys/bus/nd/devices/$pfn/align What I'm suggesting is add an optional 0th step that does: echo $raw_align > /sys/bus/nd/devices/$namespace/align Where the raw align needs to be needs to be max($pfn_align, arch_mapping_granulariy). So on powerpc where PAGE_SIZE < arch_mapping_granulariy, the following: cat /sys/bus/nd/devices/$namespace/supported_aligns ...would show the same output as: cat /sys/bus/nd/devices/$pfn/align ...but with any alignment choice less than arch_mapping_granulariy removed. All that said, the x86 vmemmap_populate() falls back to use small pages in some case to get around this constraint. Can't powerpc do the same? It would seem to be less work than the above proposal.