From owner-freebsd-current@FreeBSD.ORG Wed Jun 15 01:03:36 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC1B116A41C for ; Wed, 15 Jun 2005 01:03:36 +0000 (GMT) (envelope-from burpmaster@truffula.net) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id A036A43D1D for ; Wed, 15 Jun 2005 01:03:36 +0000 (GMT) (envelope-from burpmaster@truffula.net) Received: from [192.168.0.2] (c-67-169-200-31.hsd1.or.comcast.net[67.169.200.31]) by comcast.net (rwcrmhc12) with ESMTP id <2005061501033501400gh507e>; Wed, 15 Jun 2005 01:03:36 +0000 Message-ID: <42AF7E63.6090908@truffula.net> Date: Tue, 14 Jun 2005 18:03:31 -0700 From: Brian Rogers User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050401) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Disk cache causing swap usage X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2005 01:03:36 -0000 I have 1 GB of RAM and a 2 GB swap partition. Previously, I would almost never see swap used (or at least no more than 4k used) under normal use, but that appears to have changed recently. I am running FreeBSD 6.0-CURRENT #3: Tue Jun 14 14:25:20 PDT 2005 root@brian:/usr/obj/usr/src/sys/MYKERN My testcase for this problem is to run dd if=bigfile of=/dev/null and watch the free space drop. I expect that to happen, as the disk cache holds onto what has been read. But when free memory runs out, it starts paging out to the swap file, when it should have plenty of old cache to throw out first before resorting to the swap file. I'm pretty sure it didn't do this before, but I ran into the 20050609 issue in UPDATING when trying to run top on an old kernel to test it. This effect is also observed during normal use, and makes the system sluggish eventually. I found that setting vm.defer_swapspace_pageouts to 1 seems to prevent paging out, but I don't think it completely solves the problem, as during the dd test cursor movement still becomes erratic by the time free memory runs out. Is this a new bug in the kernel? Is anyone else seeing it?