Thread (24 messages) 24 messages, 8 authors, 2002-12-28

Re: shared pagetable benchmarking

From: Linus Torvalds <torvalds@transmeta.com>
Date: 2002-12-28 03:10:58

On Fri, 27 Dec 2002, Andrew Morton wrote:
I think we can do a few things still in the 2.6 context.  The fact that
my "apply seventy patches with patch-scripts" test takes 350,000 pagefaults
in 13 seconds makes one go "hmm".
Hmm.. Whatever happened to the MAP_POPULATE tests?

The current "filemap_populate()" function is extremely stupid (it takes 
advantage neither of the locality of the page tables _nor_ of the radix 
tree layout), but even so it would probably be a win to pre-populate at 
mmap time.

But having a better "populate()" function that actually does multiple
pages at once by just accessing the radix trees and page table trees
directly should really be very low-overhead for the normal case, and be a
_big_ win in avoiding page faults.

Even with the existing stupid populate function, it might be interesting
seeing what would happen just from doing something silly like

===== arch/i386/kernel/sys_i386.c 1.10 vs edited =====
--- 1.10/arch/i386/kernel/sys_i386.c	Sat Dec 21 08:24:45 2002
+++ edited/arch/i386/kernel/sys_i386.c	Fri Dec 27 19:08:30 2002
@@ -54,6 +54,8 @@
 		file = fget(fd);
 		if (!file)
 			goto out;
+		if (prot & PROT_EXEC)
+			flags |= MAP_POPULATE | MAP_NONBLOCK;
 	}
 
 	down_write(&current->mm->mmap_sem);
(yeah, yeah, and maybe do the same in binfmt_elf.c too)

			Linus

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help