From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 105BA6B000C for ; Thu, 1 Mar 2018 22:58:20 -0500 (EST) Received: by mail-pf0-f197.google.com with SMTP id h193so4567344pfe.14 for ; Thu, 01 Mar 2018 19:58:20 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com. [192.55.52.88]) by mx.google.com with ESMTPS id c193si4132638pfc.356.2018.03.01.19.58.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 19:58:19 -0800 (PST) Subject: [PATCH v3 3/3] device-dax: implement ->pagesize() for smaps to report MMUPageSize From: Dan Williams Date: Thu, 01 Mar 2018 19:49:12 -0800 Message-ID: <151996255287.27922.18397777516059080245.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <151996253609.27922.9983044853291257359.stgit@dwillia2-desk3.amr.corp.intel.com> References: <151996253609.27922.9983044853291257359.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: akpm@linux-foundation.org Cc: Jane Chu , linux-mm@kvack.org, linux-nvdimm@lists.01.org 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. Reported-by: Jane Chu Signed-off-by: Dan Williams --- drivers/dax/device.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/dax/device.c b/drivers/dax/device.c index 2137dbc29877..0b61f48f21a6 100644 --- a/drivers/dax/device.c +++ b/drivers/dax/device.c @@ -439,10 +439,20 @@ static int dev_dax_split(struct vm_area_struct *vma, unsigned long addr) return 0; } +static unsigned long dev_dax_pagesize(struct vm_area_struct *vma) +{ + struct file *filp = vma->vm_file; + struct dev_dax *dev_dax = filp->private_data; + struct dax_region *dax_region = dev_dax->region; + + return dax_region->align; +} + static const struct vm_operations_struct dax_vm_ops = { .fault = dev_dax_fault, .huge_fault = dev_dax_huge_fault, .split = dev_dax_split, + .pagesize = dev_dax_pagesize, }; static int dax_mmap(struct file *filp, struct vm_area_struct *vma) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org