Skip to contentSkip to conversation

powerpc/papr_scm: Don't enable direct map for a region by default

PATCH Applied Aneesh Kumar K.V 2 participants 2 messages Jan 8, 2020 – Jan 29, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/papr_scm: Don't enable direct map for a region by default

Setting ND_REGION_PAGEMAP flag implies namespace mode defaults to fsdax mode. This also means kernel ends up creating struct page backing for these namspace ranges. With large namespaces that is not the right thing to do. We should let the user select the mode he/she wants the namespace to be created with.

Hence disable ND_REGION_PAGEMAP for papr_scm regions. We still keep the flag for of_pmem because it supports only small persistent memory regions.

This is similar to what is done for x86 with commit
commit: 004f1afbe199 ("libnvdimm, pmem: direct map legacy pmem by default")

---
 arch/powerpc/platforms/pseries/papr_scm.c | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/platforms/pseries/papr_scm.c +0 -1
index 26a5ef263758..ffcd0d7a867c 100644
@@ -356,7 +356,6 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
 	ndr_desc.mapping = &mapping;
 	ndr_desc.num_mappings = 1;
 	ndr_desc.nd_set = &p->nd_set;
-	set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags);
 
 	if (p->is_volatile)
 		p->region = nvdimm_volatile_region_create(p->bus, &ndr_desc);
Signature · 1 line
2.24.1
#1 lore raw
Quoted 6 lines · Aneesh Kumar K.V

Setting ND_REGION_PAGEMAP flag implies namespace mode defaults to fsdax mode. This also means kernel ends up creating struct page backing for these namspace ranges. With large namespaces that is not the right thing to do. We should let the user select the mode he/she wants the namespace to be created with.

Quoted 7 lines

Hence disable ND_REGION_PAGEMAP for papr_scm regions. We still keep the flag for of_pmem because it supports only small persistent memory regions.

This is similar to what is done for x86 with commit
commit: 004f1afbe199 ("libnvdimm, pmem: direct map legacy pmem by default")

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/7e6f8cbc5e10cf7601c762db267b795273d53078

cheers