Skip to contentSkip to conversation

UML - Speed page fault path

PATCH New Jeff Dike 1 participant 1 message Apr 12, 2007 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 6/6 UML - Speed page fault path

Give the page fault code a specialized path. There is only one page to look at, so there's no point in going into the general page table walking code. There's only going to be one host operation, so there are no opportunities for merging. So, we go straight to the pte we want, figure out what needs doing, and do it.

While I was in here, I fixed the wart where the address passed to unmap was a void *, but an unsigned long to map and protect.

This gives me just under 10% on a kernel build.

--

 arch/um/include/os.h                  |    2 -
 arch/um/include/skas/mode_kern_skas.h |    2 +
 arch/um/kernel/skas/tlb.c             |   66 ++++++++++++++++++++++++++++++++--
 arch/um/kernel/tlb.c                  |    4 +-
 arch/um/os-Linux/skas/mem.c           |    4 +-
 5 files changed, 72 insertions(+), 6 deletions(-)
arch/um/include/skas/mode_kern_skas.h +2 -0
Index: linux-2.6.21-mm/arch/um/include/skas/mode_kern_skas.h
===================================================================
@@ -33,6 +33,8 @@ extern unsigned long set_task_sizes_skas
 extern int start_uml_skas(void);
 extern int external_pid_skas(struct task_struct *task);
 extern int thread_pid_skas(struct task_struct *task);
+extern void flush_tlb_page_skas(struct vm_area_struct *vma,
+				unsigned long address);
 
 #define kmem_end_skas (host_task_size - 1024 * 1024)
 
arch/um/kernel/skas/tlb.c +64 -2

75 lines not on this page · raw message

arch/um/kernel/tlb.c +3 -1
Index: linux-2.6.21-mm/arch/um/kernel/tlb.c
===================================================================
@@ -380,7 +380,9 @@ pte_t *addr_pte(struct task_struct *task
 void flush_tlb_page(struct vm_area_struct *vma, unsigned long address)
 {
 	address &= PAGE_MASK;
-	flush_tlb_range(vma, address, address + PAGE_SIZE);
+
+	CHOOSE_MODE(flush_tlb_range(vma, address, address + PAGE_SIZE),
+		    flush_tlb_page_skas(vma, address));
 }
 
 void flush_tlb_all(void)
arch/um/include/os.h +1 -1
Index: linux-2.6.21-mm/arch/um/include/os.h
===================================================================
@@ -302,7 +302,7 @@ extern long syscall_stub_data(struct mm_
 extern int map(struct mm_id * mm_idp, unsigned long virt,
 	       unsigned long len, int r, int w, int x, int phys_fd,
 	       unsigned long long offset, int done, void **data);
-extern int unmap(struct mm_id * mm_idp, void *addr, unsigned long len,
+extern int unmap(struct mm_id * mm_idp, unsigned long addr, unsigned long len,
 		 int done, void **data);
 extern int protect(struct mm_id * mm_idp, unsigned long addr,
 		   unsigned long len, int r, int w, int x, int done,
arch/um/os-Linux/skas/mem.c +2 -2
Index: linux-2.6.21-mm/arch/um/os-Linux/skas/mem.c
===================================================================
@@ -219,8 +219,8 @@ int map(struct mm_id * mm_idp, unsigned 
 	return ret;
 }
 
-int unmap(struct mm_id * mm_idp, void *addr, unsigned long len, int done,
-	  void **data)
+int unmap(struct mm_id * mm_idp, unsigned long addr, unsigned long len,
+	  int done, void **data)
 {
 	int ret;
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel