summaryrefslogtreecommitdiff
path: root/include/asm-alpha/pgalloc.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2002-02-12 20:27:37 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-02-12 20:27:37 -0800
commite97fde155f33869d5c6589cf239c1353684a09af (patch)
tree11200e41288eea0d2eccb49f19568e59dc386492 /include/asm-alpha/pgalloc.h
parentebae1d3a25f0f3c7a4404afc90421ad6d454e0b2 (diff)
[PATCH] flush_icache_user_range (v2.5.4)
The patch below changes access_process_vm to use a new architecture hook, flush_icache_user_range, instead of flush_icache_page, and adds a definition of flush_icache_user_range which does the same thing as flush_icache_page for all architectures except PPC. (The PPC update that is in Linus' BK tree already includes a suitable definition of flush_icache_user_range.) The reason for doing this is that when flush_icache_page is called from do_no_page or do_swap_page, I want to be able to do the flush conditionally, based on the state of the page. In contrast, access_process_vm needs to do the flush unconditionally since it has just modified the page. In the access_process_vm case it is useful to have the information about the user address and length that have been modified since then we can just flush the affected cache lines rather than the whole page. This patch should make it easy to improve performance on alpha, since there (as I understand it) the icache flush is not needed at all in do_no_page or do_swap_page, but is needed in access_process_vm. All that is needed is to make flush_icache_page a noop on alpha. The patch below doesn't do this, I'll let the alpha maintainers push that change if they want.
Diffstat (limited to 'include/asm-alpha/pgalloc.h')
-rw-r--r--include/asm-alpha/pgalloc.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
index f00acfd42a73..3463968dc087 100644
--- a/include/asm-alpha/pgalloc.h
+++ b/include/asm-alpha/pgalloc.h
@@ -70,8 +70,7 @@ flush_tlb_other(struct mm_struct *mm)
}
/* We need to flush the userspace icache after setting breakpoints in
- ptrace. I don't think it's needed in do_swap_page, or do_no_page,
- but I don't know how to get rid of it either.
+ ptrace.
Instead of indiscriminately using imb, take advantage of the fact
that icache entries are tagged with the ASN and load a new mm context. */
@@ -79,7 +78,8 @@ flush_tlb_other(struct mm_struct *mm)
#ifndef CONFIG_SMP
static inline void
-flush_icache_page(struct vm_area_struct *vma, struct page *page)
+flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
+ unsigned long addr, int len)
{
if (vma->vm_flags & VM_EXEC) {
struct mm_struct *mm = vma->vm_mm;
@@ -90,9 +90,13 @@ flush_icache_page(struct vm_area_struct *vma, struct page *page)
}
}
#else
-extern void flush_icache_page(struct vm_area_struct *vma, struct page *page);
+extern void flush_icache_user_range(struct vm_area_struct *vma,
+ struct page *page, unsigned long addr, int len);
#endif
+/* this is used only in do_no_page and do_swap_page */
+#define flush_icache_page(vma, page) flush_icache_user_range((vma), (page), 0, 0)
+
/*
* Flush just one page in the current TLB set.
* We need to be very careful about the icache here, there