Date: Mon, 4 Jan 1999 20:38:24 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Terry Lambert <tlambert@primenet.com> Cc: dyson@iquest.net, pfgiffun@bachue.usc.unal.edu.co, freebsd-hackers@FreeBSD.ORG Subject: Re: questions/problems with vm_fault() in Stable Message-ID: <199901050438.UAA91261@apollo.backplane.com> References: <199901050338.UAA03450@usr05.primenet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
:Specifically, I think that the VM references should be macro-ized :so that the underlying VM system has much less impact on the code. : :I'd like to see VFS modules portable between the BSD's (the main :obstacle at this point is that the VM intrusions aren't generalized Well, certain things, yes... not macroized, but __inline'd. But let me deal with those sorts of optimizations since I'm hip-deep in the VM code right now. I've had to rip out half a dozen such optimizations because they (A) weren't saving very many cpu cycles, and (B) they were stale and no longer in sync with the VM algorithms, and I've put *in* other less messy __inline optimizations that save about as many cycles. Basically, on too many occassions, people have ripped out pieces of VM subroutines and manually inserted them in other VM code to avoid making a subroutine call. These sorts of optimizations not only haven't produced much in the way of performance results, many of them have destabilized the codebase as other programmers have made modifications to the procedures and 'missed' the extracted pieces of code inserted in other places. There have also been some truely serious breeches of the appropriate use of __inline - 50+ line procedures inline'd with repeated calls to them in several places in the code which do more damage to the cpu's primary cache then the measily 2% call/return cycle overhead (in a 50 line procedure) that they save. But, with appropriate use of __inline functions there are quite a few optimizations that we *CAN* make to de-proceduralized the critical path. For example, the pagerops calls (vm/vm_pager.c) are currently all discrete procedures which can easily (and will soon be) migrated to __inline's in vm/vm_pager.h. :to ignore the underlying implementation (in the FreeBSD case, the :intrusion points for cache coherency have been diked out); after :that's fixed, the obstacle becomes the "cookie" crap in VOP_READDIR :(it has argument order of operation issues, which is why the NetBSD :AFS code won't work in FreeBSD), which should be murdered by splitting :the VOP_READDIR into VOP_GETDIRBLK/VOP_GETBLKENTRY to get rid of the :need for a cookie for resuming context in a directory block for NFS :and too-small-user-buffer based traversals -- at the same time paving :the way for kernel based globbing for about a 5 times speed increase :for a SAMBA/AFS specific system call KLD module). The entire VFS interface needs to be revamped. There are multiple problems with it. The one's I will concentrate on starting a month or two from now are basically the blocking and low-memory deadlock situations that crop up when you have multiple VFS layers. I've already fixed about a half a dozen low-memory or buffer-exhaustion deadlock situations that will be committed to the new -current after the CVS tree splits - you can actually take a 30MB core dump onto an MFS filesystem on a 48MB machine using NFS based swap now while simultaniously running a vnode-eating (find /usr | xargs md5) and memory-eating (allocate/touch/loop) program. Over and over again. In anycase, anyone interested in looking at my current patch-set, which due to its complexity also includes the more seriously changed files en-toto, can look at it at: http://www.backplane.com/FreeBSD/ http://www.backplane.com/FreeBSD/dillon-swapper-A8.tgz No comments on syntax or #if 0's, please - there will be a general cleanup pass after the initial commit after the tree splits. Also ignore the stuff that isn't obviously related to the VM system, like the if_slip junk -- those aren't really part of this project. This is the stuff that I've been working on with DG and John. It is quite extensive: don't try to understand the unified diff for vm/vm_page.c or vm/swap_pager.c, look at the files included along with the diff in the tar instead. New swapper, new swap bitmap allocator, moderate vm_page_t handling changes, and lots of other junk. Not all the code has been optimized yet, though due to the removal or reduction of two major linear linked lists it's probably already much faster then the old code despite the unwinding of some of the (improperly done) manual code inlining. : Terry Lambert : terry@lambert.org Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet Communications & God knows what else. <dillon@backplane.com> (Please include original email in any response) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901050438.UAA91261>