From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) by kanga.kvack.org (Postfix) with ESMTP id C53286B003A for ; Fri, 1 Aug 2014 15:21:13 -0400 (EDT) Received: by mail-qg0-f49.google.com with SMTP id j107so6274648qga.8 for ; Fri, 01 Aug 2014 12:21:13 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id d69si17220330qgd.88.2014.08.01.12.21.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Aug 2014 12:21:13 -0700 (PDT) From: Naoya Horiguchi Subject: [PATCH -mm v6 06/13] pagemap: use walk->vma instead of calling find_vma() Date: Fri, 1 Aug 2014 15:20:42 -0400 Message-Id: <1406920849-25908-7-git-send-email-n-horiguchi@ah.jp.nec.com> In-Reply-To: <1406920849-25908-1-git-send-email-n-horiguchi@ah.jp.nec.com> References: <1406920849-25908-1-git-send-email-n-horiguchi@ah.jp.nec.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Dave Hansen , Hugh Dickins , "Kirill A. Shutemov" , Jerome Marchand , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Naoya Horiguchi Page table walker has the information of the current vma in mm_walk, so we don't have to call find_vma() in each pagemap_hugetlb_range() call. NULL-vma check is omitted because we assume that we never run hugetlb_entry() callback on the address without vma. And even if it were broken, null pointer dereference would be detected, so we can get enough information for debugging. Signed-off-by: Naoya Horiguchi Acked-by: Kirill A. Shutemov --- fs/proc/task_mmu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git mmotm-2014-07-30-15-57.orig/fs/proc/task_mmu.c mmotm-2014-07-30-15-57/fs/proc/task_mmu.c index 4baf34230191..e4c6cdb9647b 100644 --- mmotm-2014-07-30-15-57.orig/fs/proc/task_mmu.c +++ mmotm-2014-07-30-15-57/fs/proc/task_mmu.c @@ -1073,15 +1073,12 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long hmask, struct mm_walk *walk) { struct pagemapread *pm = walk->private; - struct vm_area_struct *vma; + struct vm_area_struct *vma = walk->vma; int err = 0; int flags2; pagemap_entry_t pme; - vma = find_vma(walk->mm, addr); - WARN_ON_ONCE(!vma); - - if (vma && (vma->vm_flags & VM_SOFTDIRTY)) + if (vma->vm_flags & VM_SOFTDIRTY) flags2 = __PM_SOFT_DIRTY; else flags2 = 0; -- 1.9.3 -- 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