Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176317
b: refs/heads/master
c: d33b9f4
h: refs/heads/master
i:
  176315: b4b9ed5
v: v3
  • Loading branch information
Naoya Horiguchi authored and Linus Torvalds committed Dec 15, 2009
1 parent 60b08cf commit ec72b75
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f16fc107d9c9b8a72aa19b189a9216e90a7aaef
refs/heads/master: d33b9f45bd24a6391bc05e2b5a13c1b5787ca9c2
16 changes: 15 additions & 1 deletion trunk/mm/pagewalk.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/sched.h>
#include <linux/hugetlb.h>

static int walk_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
struct mm_walk *walk)
Expand Down Expand Up @@ -107,6 +108,7 @@ int walk_page_range(unsigned long addr, unsigned long end,
pgd_t *pgd;
unsigned long next;
int err = 0;
struct vm_area_struct *vma;

if (addr >= end)
return err;
Expand All @@ -117,11 +119,22 @@ int walk_page_range(unsigned long addr, unsigned long end,
pgd = pgd_offset(walk->mm, addr);
do {
next = pgd_addr_end(addr, end);

/* skip hugetlb vma to avoid hugepage PMD being cleared
* in pmd_none_or_clear_bad(). */
vma = find_vma(walk->mm, addr);
if (vma && is_vm_hugetlb_page(vma)) {
if (vma->vm_end < next)
next = vma->vm_end;
continue;
}

if (pgd_none_or_clear_bad(pgd)) {
if (walk->pte_hole)
err = walk->pte_hole(addr, next, walk);
if (err)
break;
pgd++;
continue;
}
if (walk->pgd_entry)
Expand All @@ -131,7 +144,8 @@ int walk_page_range(unsigned long addr, unsigned long end,
err = walk_pud_range(pgd, addr, next, walk);
if (err)
break;
} while (pgd++, addr = next, addr != end);
pgd++;
} while (addr = next, addr != end);

return err;
}

0 comments on commit ec72b75

Please sign in to comment.