Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5555
b: refs/heads/master
c: 4ceb5db
h: refs/heads/master
i:
  5553: 267da4a
  5551: 1d390d7
v: v3
  • Loading branch information
Linus Torvalds committed Aug 1, 2005
1 parent 8f478df commit 14fb7a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 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: 8d894c47975f7222c5537e450e71310b395488c7
refs/heads/master: 4ceb5db9757aaeadcf8fbbf97d76bd42aa4df0d6
21 changes: 4 additions & 17 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,18 +811,15 @@ static struct page *__follow_page(struct mm_struct *mm, unsigned long address,
pte = *ptep;
pte_unmap(ptep);
if (pte_present(pte)) {
if (write && !pte_write(pte))
if (write && !pte_dirty(pte))
goto out;
if (read && !pte_read(pte))
goto out;
pfn = pte_pfn(pte);
if (pfn_valid(pfn)) {
page = pfn_to_page(pfn);
if (accessed) {
if (write && !pte_dirty(pte) &&!PageDirty(page))
set_page_dirty(page);
if (accessed)
mark_page_accessed(page);
}
return page;
}
}
Expand Down Expand Up @@ -941,19 +938,17 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
spin_lock(&mm->page_table_lock);
do {
struct page *page;
int lookup_write = write;

cond_resched_lock(&mm->page_table_lock);
while (!(page = follow_page(mm, start, lookup_write))) {
while (!(page = follow_page(mm, start, write))) {
/*
* Shortcut for anonymous pages. We don't want
* to force the creation of pages tables for
* insanely big anonymously mapped areas that
* nobody touched so far. This is important
* for doing a core dump for these mappings.
*/
if (!lookup_write &&
untouched_anonymous_page(mm,vma,start)) {
if (!write && untouched_anonymous_page(mm,vma,start)) {
page = ZERO_PAGE(start);
break;
}
Expand All @@ -972,14 +967,6 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
default:
BUG();
}
/*
* Now that we have performed a write fault
* and surely no longer have a shared page we
* shouldn't write, we shouldn't ignore an
* unwritable page in the page table if
* we are forcing write access.
*/
lookup_write = write && !force;
spin_lock(&mm->page_table_lock);
}
if (pages) {
Expand Down

0 comments on commit 14fb7a4

Please sign in to comment.