Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-19 Thread Dan Williams
On Tue, Nov 19, 2019 at 7:19 PM Aneesh Kumar K.V wrote: > > On 11/19/19 11:28 PM, Dan Williams wrote: > > On Mon, Nov 18, 2019 at 1:52 AM Aneesh Kumar K.V > > wrote: > >> > >> Dan Williams writes: > >> > >>> On Sat, Nov 16, 2019 at 4:15 AM Aneesh Kumar K.V > >>> wrote: > > >> > >> > >

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-19 Thread Aneesh Kumar K.V
On 11/19/19 11:28 PM, Dan Williams wrote: On Mon, Nov 18, 2019 at 1:52 AM Aneesh Kumar K.V wrote: Dan Williams writes: On Sat, Nov 16, 2019 at 4:15 AM Aneesh Kumar K.V wrote: Considering the direct-map map size is not going to be user selectable, do you agree that we can skip

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-19 Thread Dan Williams
On Mon, Nov 18, 2019 at 1:52 AM Aneesh Kumar K.V wrote: > > Dan Williams writes: > > > On Sat, Nov 16, 2019 at 4:15 AM Aneesh Kumar K.V > > wrote: > >> > > > > > >> > >> Considering the direct-map map size is not going to be user selectable, > >> do you agree that we can skip the above step

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-18 Thread Aneesh Kumar K.V
Dan Williams writes: > On Sat, Nov 16, 2019 at 4:15 AM Aneesh Kumar K.V > wrote: >> >> >> Considering the direct-map map size is not going to be user selectable, >> do you agree that we can skip the above step 0 configuration you >> suggested. >> >> The changes proposed in the patch seri

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-16 Thread Dan Williams
On Sat, Nov 16, 2019 at 4:15 AM Aneesh Kumar K.V wrote: > > > Hi Dan, > > "Aneesh Kumar K.V" writes: > > > Dan Williams writes: > > > >> On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V > >> wrote: > >> [..] > >>> > True, for the pfn device and the device-dax mapping size, but I'm > >>> > sugg

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-16 Thread Aneesh Kumar K.V
Hi Dan, "Aneesh Kumar K.V" writes: > Dan Williams writes: > >> On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V >> 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

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-11-06 Thread Aneesh Kumar K.V
Dan Williams writes: > On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V > 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 th

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-31 Thread Dan Williams
On Thu, Oct 31, 2019 at 1:38 AM Aneesh Kumar K.V wrote: > > On 10/31/19 12:00 PM, Dan Williams wrote: > > On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V > > wrote: > > [..] > > > > > > > All that said, the x86 vmemmap_populate() falls back to use small > > pages in some case to get around this

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-31 Thread Aneesh Kumar K.V
On 10/31/19 12:00 PM, Dan Williams wrote: On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V wrote: [..] 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

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-30 Thread Dan Williams
On Wed, Oct 30, 2019 at 10:35 PM Aneesh Kumar K.V 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 gr

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-30 Thread Aneesh Kumar K.V
On 10/29/19 11:00 AM, Dan Williams wrote: On Mon, Oct 28, 2019 at 9:35 PM Aneesh Kumar K.V wrote: On 10/29/19 4:38 AM, Dan Williams wrote: On Mon, Oct 28, 2019 at 2:48 AM Aneesh Kumar K.V wrote: The page size used to map the namespace is arch dependent. For example architectures like ppc64

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-28 Thread Dan Williams
On Mon, Oct 28, 2019 at 9:35 PM Aneesh Kumar K.V wrote: > > On 10/29/19 4:38 AM, Dan Williams wrote: > > On Mon, Oct 28, 2019 at 2:48 AM Aneesh Kumar K.V > > wrote: > >> > >> The page size used to map the namespace is arch dependent. For example > >> architectures like ppc64 use 16MB page size fo

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-28 Thread Aneesh Kumar K.V
On 10/29/19 2:51 AM, Ira Weiny wrote: diff --git a/arch/powerpc/lib/pmem.c b/arch/powerpc/lib/pmem.c index 377712e85605..2e661a08dae5 100644 --- a/arch/powerpc/lib/pmem.c +++ b/arch/powerpc/lib/pmem.c @@ -17,14 +17,31 @@ void arch_wb_cache_pmem(void *addr, size_t size) unsigned long start

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-28 Thread Aneesh Kumar K.V
On 10/29/19 4:38 AM, Dan Williams wrote: On Mon, Oct 28, 2019 at 2:48 AM Aneesh Kumar K.V wrote: The page size used to map the namespace is arch dependent. For example architectures like ppc64 use 16MB page size for direct-mapping. If the namespace size is not aligned to the mapping page size,

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-28 Thread Dan Williams
On Mon, Oct 28, 2019 at 2:48 AM Aneesh Kumar K.V wrote: > > The page size used to map the namespace is arch dependent. For example > architectures like ppc64 use 16MB page size for direct-mapping. If the > namespace > size is not aligned to the mapping page size, we can observe kernel crash > dur

Re: [RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-28 Thread Ira Weiny
> diff --git a/arch/powerpc/lib/pmem.c b/arch/powerpc/lib/pmem.c > index 377712e85605..2e661a08dae5 100644 > --- a/arch/powerpc/lib/pmem.c > +++ b/arch/powerpc/lib/pmem.c > @@ -17,14 +17,31 @@ void arch_wb_cache_pmem(void *addr, size_t size) > unsigned long start = (unsigned long) addr; >

[RFC PATCH 1/4] libnvdimm/namespace: Make namespace size validation arch dependent

2019-10-28 Thread Aneesh Kumar K.V
The page size used to map the namespace is arch dependent. For example architectures like ppc64 use 16MB page size for direct-mapping. If the namespace size is not aligned to the mapping page size, we can observe kernel crash during namespace init and destroy. This is due to kernel doing partial m