Date: Sun, 05 Apr 1998 18:40:39 -0700 From: "David E. Tweten" <tweten@frihet.com> To: Dan Swartzendruber <dswartz@druber.com> Cc: dyson@FreeBSD.ORG, dg@root.com, dag-erli@ifi.uio.no, stable@FreeBSD.ORG Subject: Re: swap-leak in 2.2.5 ? Message-ID: <199804060140.SAA03046@ns.frihet.com>
next in thread | raw e-mail | index | archive | help
dswartz@druber.com said: >Here's an off-the-cuff idea: since the confusing usage of swap as a >caching mechanism is only a performance optimization, how bogus would >it be to not report it. Lie. If my workstation has 64MB of swap set >up, 8 of which is being used for real backing store, and 12 of which >is being used to cache filesystem pages, have swapinfo lie and report >only 8MB in use. The 4.4 BSD interaction between physical pages used for virtual memory and physical pages used for file system cache doesn't work that way, and I can't imagine the FreeBSD core team adding in such a botch. It is never a good idea to send a dirty file system cache page to swap. It is always better to send it to the file system. After all, it might never again be written. If it is ever written, it will have to be read into memory again either way. If it never gets written, it's a win to have written to the file system and a lose to swap. If it gets written, it's a tie. Therefore, never write dirty file system cache buffers to swap. What you see in swap under heavy I/O load, is dirty process virtual memory pages moved out of real memory to make way for an expanding file system cache. There's no reason to read them back until the process faults for them; it might exit first, allowing you to just abandon them. -- David E. Tweten | 2047-bit PGP fingerprint: | tweten@frihet.com 12141 Atrium Drive | E9 59 E7 5C 6B 88 B8 90 | tweten@and.com Saratoga, CA 95070-3162 | 65 30 2A A4 A0 BC 49 AE | (408) 446-4131 Those who make good products sell products; those who don't, sell solutions. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804060140.SAA03046>