diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2017-06-27 19:56:33 +1000 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-07-25 16:30:51 -0700 |
commit | 0dd69643061d78f3f9047c2382d8d77cca1ac943 (patch) | |
tree | d290332080ff1b4bcfb60bbcbf3b09944e7caaa8 /drivers/nvdimm/nd.h | |
parent | 520eccdfe187591a51ea9ab4c1a024ae4d0f68d9 (diff) | |
download | linux-stable-0dd69643061d78f3f9047c2382d8d77cca1ac943.tar.gz linux-stable-0dd69643061d78f3f9047c2382d8d77cca1ac943.tar.bz2 linux-stable-0dd69643061d78f3f9047c2382d8d77cca1ac943.zip |
libnvdimm: Stop using HPAGE_SIZE
Currently libnvdimm uses HPAGE_SIZE as the default alignment for DAX and
PFN devices. HPAGE_SIZE is the default hugetlbfs page size and when
hugetlbfs is disabled it defaults to PAGE_SIZE. Given DAX has more
in common with THP than hugetlbfs we should proably be using
HPAGE_PMD_SIZE, but this is undefined when THP is disabled so lets just
give it a new name.
The other usage of HPAGE_SIZE in libnvdimm is when determining how large
the altmap should be. For the reasons mentioned above it doesn't really
make sense to use HPAGE_SIZE here either. PMD_SIZE seems to be safe to
use in generic code and it happens to match the vmemmap allocation block
on x86 and Power. It's still a hack, but it's a slightly nicer hack.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/nd.h')
-rw-r--r-- | drivers/nvdimm/nd.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index e1b5715bd91f..e9fa9e84b364 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -285,6 +285,13 @@ static inline struct device *nd_btt_create(struct nd_region *nd_region) struct nd_pfn *to_nd_pfn(struct device *dev); #if IS_ENABLED(CONFIG_NVDIMM_PFN) + +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +#define PFN_DEFAULT_ALIGNMENT HPAGE_PMD_SIZE +#else +#define PFN_DEFAULT_ALIGNMENT PAGE_SIZE +#endif + int nd_pfn_probe(struct device *dev, struct nd_namespace_common *ndns); bool is_nd_pfn(struct device *dev); struct device *nd_pfn_create(struct nd_region *nd_region); |