Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Nov 1998 20:28:20 +0100
From:      Eivind Eklund <eivind@yes.no>
To:        Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
Cc:        dg@root.com, John Fieber <jfieber@indiana.edu>, current@FreeBSD.ORG
Subject:   Re: The infamous dying daemons bug
Message-ID:  <19981108202820.49780@follo.net>
In-Reply-To: <199811081806.VAA00888@tejblum.dnttm.rssi.ru>; from Dmitrij Tejblum on Sun, Nov 08, 1998 at 09:06:29PM %2B0300
References:  <19981108171319.19261@follo.net> <199811081806.VAA00888@tejblum.dnttm.rssi.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981108202820.49780>