From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by kanga.kvack.org (Postfix) with ESMTP id 487406B0006 for ; Tue, 5 Jan 2016 13:30:16 -0500 (EST) Received: by mail-pf0-f181.google.com with SMTP id 78so226822954pfw.2 for ; Tue, 05 Jan 2016 10:30:16 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com. [192.55.52.88]) by mx.google.com with ESMTP id h10si61187382pat.126.2016.01.05.10.30.14 for ; Tue, 05 Jan 2016 10:30:14 -0800 (PST) From: Matthew Wilcox Subject: [PATCH v2 4/8] mincore: Add support for PUDs Date: Tue, 5 Jan 2016 13:30:06 -0500 Message-Id: <1452018610-26090-5-git-send-email-matthew.r.wilcox@intel.com> In-Reply-To: <1452018610-26090-1-git-send-email-matthew.r.wilcox@intel.com> References: <1452018610-26090-1-git-send-email-matthew.r.wilcox@intel.com> Sender: owner-linux-mm@kvack.org List-ID: Cc: Matthew Wilcox , linux-mm@kvack.org, linux-nvdimm@lists.01.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org From: Matthew Wilcox We don't actually care about the contents of the PUD, as long as it's present (which is checked by the pagewalk code), so just set the bits to indicate presence and return. Signed-off-by: Matthew Wilcox --- mm/mincore.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mm/mincore.c b/mm/mincore.c index 2a565ed..8e6ce12 100644 --- a/mm/mincore.c +++ b/mm/mincore.c @@ -108,6 +108,18 @@ static int mincore_unmapped_range(unsigned long addr, unsigned long end, return 0; } +static int mincore_pud_range(pud_t *pud, unsigned long addr, unsigned long end, + struct mm_walk *walk) +{ + unsigned char *vec = walk->private; + int nr = (end - addr) >> PAGE_SHIFT; + + memset(vec, 1, nr); + walk->private += nr; + + return 0; +} + static int mincore_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk) { @@ -176,6 +188,7 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v unsigned long end; int err; struct mm_walk mincore_walk = { + .pud_entry = mincore_pud_range, .pmd_entry = mincore_pte_range, .pte_hole = mincore_unmapped_range, .hugetlb_entry = mincore_hugetlb, -- 2.6.4 -- 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