Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73682
b: refs/heads/master
c: 3ad33b2
h: refs/heads/master
v: v3
  • Loading branch information
Lee Schermerhorn authored and Linus Torvalds committed Nov 15, 2007
1 parent cb72629 commit 0ff6e94
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 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: e1a1c997afe907e6ec4799e4be0f38cffd8b418c
refs/heads/master: 3ad33b2436b545cbe8b28e53f3710432cad457ab
21 changes: 19 additions & 2 deletions trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,12 +722,29 @@ int do_migrate_pages(struct mm_struct *mm,

}

/*
* Allocate a new page for page migration based on vma policy.
* Start assuming that page is mapped by vma pointed to by @private.
* Search forward from there, if not. N.B., this assumes that the
* list of pages handed to migrate_pages()--which is how we get here--
* is in virtual address order.
*/
static struct page *new_vma_page(struct page *page, unsigned long private, int **x)
{
struct vm_area_struct *vma = (struct vm_area_struct *)private;
unsigned long uninitialized_var(address);

return alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma,
page_address_in_vma(page, vma));
while (vma) {
address = page_address_in_vma(page, vma);
if (address != -EFAULT)
break;
vma = vma->vm_next;
}

/*
* if !vma, alloc_page_vma() will use task or system default policy
*/
return alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, address);
}
#else

Expand Down
7 changes: 4 additions & 3 deletions trunk/mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ static void page_unlock_anon_vma(struct anon_vma *anon_vma)
}

/*
* At what user virtual address is page expected in vma?
* At what user virtual address is page expected in @vma?
* Returns virtual address or -EFAULT if page's index/offset is not
* within the range mapped the @vma.
*/
static inline unsigned long
vma_address(struct page *page, struct vm_area_struct *vma)
Expand All @@ -193,8 +195,7 @@ vma_address(struct page *page, struct vm_area_struct *vma)

address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
if (unlikely(address < vma->vm_start || address >= vma->vm_end)) {
/* page should be within any vma from prio_tree_next */
BUG_ON(!PageAnon(page));
/* page should be within @vma mapping range */
return -EFAULT;
}
return address;
Expand Down

0 comments on commit 0ff6e94

Please sign in to comment.