Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108948
b: refs/heads/master
c: 479db0b
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Aug 20, 2008
1 parent 4dd53e3 commit df265c3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 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: 2d70b68d42b5196a48ccb639e3797f097ef5bea3
refs/heads/master: 479db0bf408e65baa14d2a9821abfcbc0804b847
2 changes: 1 addition & 1 deletion trunk/include/linux/rmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int try_to_unmap(struct page *, int ignore_refs);
* Called from mm/filemap_xip.c to unmap empty zero page
*/
pte_t *page_check_address(struct page *, struct mm_struct *,
unsigned long, spinlock_t **);
unsigned long, spinlock_t **, int);

/*
* Used by swapoff to help locate where page is expected in vma.
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/filemap_xip.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ __xip_unmap (struct address_space * mapping,
address = vma->vm_start +
((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
BUG_ON(address < vma->vm_start || address >= vma->vm_end);
pte = page_check_address(page, mm, address, &ptl);
pte = page_check_address(page, mm, address, &ptl, 1);
if (pte) {
/* Nuke the page table entry. */
flush_cache_page(vma, address, pte_pfn(*pte));
Expand Down
14 changes: 9 additions & 5 deletions trunk/mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,14 @@ unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma)
/*
* Check that @page is mapped at @address into @mm.
*
* If @sync is false, page_check_address may perform a racy check to avoid
* the page table lock when the pte is not present (helpful when reclaiming
* highly shared pages).
*
* On success returns with pte mapped and locked.
*/
pte_t *page_check_address(struct page *page, struct mm_struct *mm,
unsigned long address, spinlock_t **ptlp)
unsigned long address, spinlock_t **ptlp, int sync)
{
pgd_t *pgd;
pud_t *pud;
Expand All @@ -249,7 +253,7 @@ pte_t *page_check_address(struct page *page, struct mm_struct *mm,

pte = pte_offset_map(pmd, address);
/* Make a quick check before getting the lock */
if (!pte_present(*pte)) {
if (!sync && !pte_present(*pte)) {
pte_unmap(pte);
return NULL;
}
Expand Down Expand Up @@ -281,7 +285,7 @@ static int page_referenced_one(struct page *page,
if (address == -EFAULT)
goto out;

pte = page_check_address(page, mm, address, &ptl);
pte = page_check_address(page, mm, address, &ptl, 0);
if (!pte)
goto out;

Expand Down Expand Up @@ -450,7 +454,7 @@ static int page_mkclean_one(struct page *page, struct vm_area_struct *vma)
if (address == -EFAULT)
goto out;

pte = page_check_address(page, mm, address, &ptl);
pte = page_check_address(page, mm, address, &ptl, 1);
if (!pte)
goto out;

Expand Down Expand Up @@ -704,7 +708,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
if (address == -EFAULT)
goto out;

pte = page_check_address(page, mm, address, &ptl);
pte = page_check_address(page, mm, address, &ptl, 0);
if (!pte)
goto out;

Expand Down

0 comments on commit df265c3

Please sign in to comment.