From owner-freebsd-stable Sun Apr 5 18:41:10 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA19361 for freebsd-stable-outgoing; Sun, 5 Apr 1998 18:41:10 -0700 (PDT) (envelope-from owner-freebsd-stable@FreeBSD.ORG) Received: from ns.frihet.com (root@frihet.bayarea.net [205.219.92.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA19244; Sun, 5 Apr 1998 18:40:45 -0700 (PDT) (envelope-from tweten@ns.frihet.com) Received: from ns.frihet.com (tweten@localhost [127.0.0.1]) by ns.frihet.com (8.8.8/8.8.8) with ESMTP id SAA03046; Sun, 5 Apr 1998 18:40:39 -0700 (PDT) (envelope-from tweten@ns.frihet.com) Message-Id: <199804060140.SAA03046@ns.frihet.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Dan Swartzendruber cc: dyson@FreeBSD.ORG, dg@root.com, dag-erli@ifi.uio.no, stable@FreeBSD.ORG Subject: Re: swap-leak in 2.2.5 ? From: "David E. Tweten" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 05 Apr 1998 18:40:39 -0700 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk 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