diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-25 17:56:23 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-25 17:56:23 -0700 |
commit | 6314b8e29bf462a34dde8f05d3eb1ec1a893a65c (patch) | |
tree | 5c4e550f35ae9b4df95ffd221e8640938c2c0751 /mm | |
parent | 5e681ee3377fbb5d6ba5a0850189419eb4b8f0a4 (diff) | |
download | history-6314b8e29bf462a34dde8f05d3eb1ec1a893a65c.tar.gz |
Split ptep_establish into "establish" and "update_access_flags"
ptep_establish() is used to establish a new mapping at COW time,
and it always replaces a non-writable page mapping with a totally
new page mapping that is dirty (and likely writable, although ptrace
may cause a non-writable new mapping). Because it was nonwritable,
we don't have to worry about losing concurrent dirty page bit updates.
ptep_update_access_flags() leaves the same page mapping, but updates
the accessed/dirty/writable bits (it only ever sets them, and never
removes any permissions). Often easier, but it may race with a dirty
bit update on another CPU.
Booted on x86 and ppc64.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c index 2ae115e4bd0927..57807075890527 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1004,7 +1004,7 @@ static inline void break_cow(struct vm_area_struct * vma, struct page * new_page flush_cache_page(vma, address); entry = maybe_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot)), vma); - ptep_establish(vma, address, page_table, entry, 1); + ptep_establish(vma, address, page_table, entry); update_mmu_cache(vma, address, entry); } @@ -1056,7 +1056,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma, flush_cache_page(vma, address); entry = maybe_mkwrite(pte_mkyoung(pte_mkdirty(pte)), vma); - ptep_establish(vma, address, page_table, entry, 1); + ptep_set_access_flags(vma, address, page_table, entry, 1); update_mmu_cache(vma, address, entry); pte_unmap(page_table); spin_unlock(&mm->page_table_lock); @@ -1646,7 +1646,7 @@ static inline int handle_pte_fault(struct mm_struct *mm, entry = pte_mkdirty(entry); } entry = pte_mkyoung(entry); - ptep_establish(vma, address, pte, entry, write_access); + ptep_set_access_flags(vma, address, pte, entry, write_access); update_mmu_cache(vma, address, entry); pte_unmap(pte); spin_unlock(&mm->page_table_lock); |