From owner-freebsd-current Sun Nov 8 11:39:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA12152 for freebsd-current-outgoing; Sun, 8 Nov 1998 11:39:32 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA12147 for ; Sun, 8 Nov 1998 11:39:27 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.1a/8.9.1) with ESMTP id UAA11970; Sun, 8 Nov 1998 20:29:23 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id UAA06890; Sun, 8 Nov 1998 20:29:23 +0100 (MET) Message-ID: <19981108202820.49780@follo.net> Date: Sun, 8 Nov 1998 20:28:20 +0100 From: Eivind Eklund To: Dmitrij Tejblum Cc: dg@root.com, John Fieber , current@FreeBSD.ORG Subject: Re: The infamous dying daemons bug References: <19981108171319.19261@follo.net> <199811081806.VAA00888@tejblum.dnttm.rssi.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1i In-Reply-To: <199811081806.VAA00888@tejblum.dnttm.rssi.ru>; from Dmitrij Tejblum on Sun, Nov 08, 1998 at 09:06:29PM +0300 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Nov 08, 1998 at 09:06:29PM +0300, Dmitrij Tejblum wrote: > Eivind Eklund wrote: > > > > Oh, and another aspect: This suddenly started happening. It has been > > stable for 3/4 of a year, and then suddenly started happening > > reproducably one day, after a kernel update while John was doing his > > changes. > > Please don't tell anyone, but I am almost convinced that the bug is > here: > > -----swap_pager.c, line 1132------ > /* > * If we're out of swap space, then attempt to free > * some whenever multiple pages are brought in. We > * must set the dirty bits so that the page contents > * will be preserved. > */ > if (SWAPLOW || > (vm_swap_size < btodb((cnt.v_page_count - cnt.v_wire_count)) * PAGE_SIZE)) { > for (i = 0; i < count; i++) { > m[i]->dirty = VM_PAGE_BITS_ALL; > } > swap_pager_freespace(object, > m[0]->pindex + paging_offset, count); > } > ------------------------------------ > If I sysctl out the call to swap_pager_freespace, all symptoms > disappear. This code activates at about the time when the "suggest more > swap space" message printed. IIRC, it was introduced by John Dyson this > winter. > > (Perhaps, the code just triggers a bug elsewhere... No idea what is > wrong). This code is pretty old, but the context for it was changed in revision 1.89 of vm_swap_pager.c on the 23rd of february. It match the time pretty well. revision 1.89 date: 1998/02/23 08:22:24; author: dyson; state: Exp; lines: +273 -285 Significantly improve the efficiency of the swap pager, which appears to have declined due to code-rot over time. The swap pager rundown code has been clean-up, and unneeded wakeups removed. Lots of splbio's are changed to splvm's. Also, set the dynamic tunables for the pageout daemon to be more sane for larger systems (thereby decreasing the daemon overheadla.) I'm not able to fully wrap my head around the code in question - it seems like there are interactions with lots of other parts. It looks as if there might a problem with the removal of the use of of the swap_pager_free TAILQ in swap_pager_getpages, but I don't understand why this would cause a problem, and I'm not sure which other changes are related to this, so I can't easily just back that part out. If anybody else is going to look at it, I found the best way to get an overview given the type of changes is with cvs diff -c -w -r1.88 -r1.89 /sys/vm/swap_pager.c | $PAGER in one window, and $PAGER /sys/vm/swap_pager.c in another. If you don't drop whitespace changes, it is close to impossible to read (given that some things have changed their indentation level). For once, context diffs were also better than unified diffs. Eivind. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message