[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140602213645.290B349F@viggo.jf.intel.com>
Date: Mon, 02 Jun 2014 14:36:45 -0700
From: Dave Hansen <dave@...1.net>
To: linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, kirill.shutemov@...ux.intel.com,
Dave Hansen <dave@...1.net>
Subject: [PATCH 01/10] mm: pagewalk: consolidate vma->vm_start checks
From: Dave Hansen <dave.hansen@...ux.intel.com>
We check vma->vm_start against the address being walked twice.
Consolidate the locations down to a single one.
Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
---
b/mm/pagewalk.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff -puN mm/pagewalk.c~pagewalk-always-skip-hugetlbfs-except-when-explicitly-handled mm/pagewalk.c
--- a/mm/pagewalk.c~pagewalk-always-skip-hugetlbfs-except-when-explicitly-handled 2014-06-02 14:20:18.938791410 -0700
+++ b/mm/pagewalk.c 2014-06-02 14:20:18.941791545 -0700
@@ -192,13 +192,12 @@ int walk_page_range(unsigned long addr,
* - VM_PFNMAP vma's
*/
vma = find_vma(walk->mm, addr);
- if (vma) {
+ if (vma && (vma->vm_start <= addr)) {
/*
* There are no page structures backing a VM_PFNMAP
* range, so do not allow split_huge_page_pmd().
*/
- if ((vma->vm_start <= addr) &&
- (vma->vm_flags & VM_PFNMAP)) {
+ if (vma->vm_flags & VM_PFNMAP) {
next = vma->vm_end;
pgd = pgd_offset(walk->mm, next);
continue;
@@ -209,8 +208,7 @@ int walk_page_range(unsigned long addr,
* architecture and we can't handled it in the same
* manner as non-huge pages.
*/
- if (walk->hugetlb_entry && (vma->vm_start <= addr) &&
- is_vm_hugetlb_page(vma)) {
+ if (walk->hugetlb_entry && is_vm_hugetlb_page(vma)) {
if (vma->vm_end < next)
next = vma->vm_end;
/*
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists