Skip to content

Commit 4a5bf01

Browse files
djbwjfvogel
authored andcommitted
device-dax: implement ->pagesize() for smaps to report MMUPageSize
Given that device-dax is making similar page mapping size guarantees as hugetlbfs, emit the size in smaps and any other kernel path that requests the mapping size of a vma. Link: http://lkml.kernel.org/r/151996255287.27922.18397777516059080245.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <[email protected]> Reported-by: Jane Chu <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Paul Mackerras <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> (cherry picked from commit c1d53b9) Orabug: 27262713 Signed-off-by: Jane Chu <[email protected]> Reviewed-by: Steve Sistare <[email protected]> Reviewed-by: Darren Kenny <[email protected]>
1 parent fcc912b commit 4a5bf01

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/dax/device.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,20 @@ static int dev_dax_split(struct vm_area_struct *vma, unsigned long addr)
439439
return 0;
440440
}
441441

442+
static unsigned long dev_dax_pagesize(struct vm_area_struct *vma)
443+
{
444+
struct file *filp = vma->vm_file;
445+
struct dev_dax *dev_dax = filp->private_data;
446+
struct dax_region *dax_region = dev_dax->region;
447+
448+
return dax_region->align;
449+
}
450+
442451
static const struct vm_operations_struct dax_vm_ops = {
443452
.fault = dev_dax_fault,
444453
.huge_fault = dev_dax_huge_fault,
445454
.split = dev_dax_split,
455+
.pagesize = dev_dax_pagesize,
446456
};
447457

448458
static int dax_mmap(struct file *filp, struct vm_area_struct *vma)

0 commit comments

Comments
 (0)