From owner-freebsd-current Mon Nov 9 17:43:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA22139 for freebsd-current-outgoing; Mon, 9 Nov 1998 17:43:07 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from burka.carrier.kiev.ua (burka.carrier.kiev.ua [193.193.193.107]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA22132 for ; Mon, 9 Nov 1998 17:43:01 -0800 (PST) (envelope-from archer@grape.carrier.kiev.ua) Received: from kozlik.carrier.kiev.ua (kozlik.carrier.kiev.ua [193.193.193.111]) by burka.carrier.kiev.ua (8.9.0/8.Who.Cares) with ESMTP id DAA09815; Tue, 10 Nov 1998 03:42:36 +0200 (EET) (envelope-from archer@grape.carrier.kiev.ua) Received: (from uucp@localhost) by kozlik.carrier.kiev.ua (8.9.0/8.9.0/8.Who.Cares) with UUCP id DAA05575; Tue, 10 Nov 1998 03:40:45 +0200 (EET) (envelope-from archer@grape.carrier.kiev.ua) Received: (from archer@localhost) by grape.carrier.kiev.ua (8.9.1/8.9.1) id DAA00563; Tue, 10 Nov 1998 03:36:28 +0200 (EET) (envelope-from archer) Date: Tue, 10 Nov 1998 03:36:28 +0200 (EET) From: Alexander Litvin Message-Id: <199811100136.DAA00563@grape.carrier.kiev.ua> To: Luoqi Chen Cc: current@FreeBSD.ORG Subject: Re: The infamous dying daemons bug X-Newsgroups: grape.freebsd.current In-Reply-To: <199811092056.PAA22043@lor.watermarkgroup.com> Organization: Lucky Grape User-Agent: tin/pre-1.4-980818 ("Laura") (UNIX) (FreeBSD/3.0-CURRENT (i386)) Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <199811092056.PAA22043@lor.watermarkgroup.com> you wrote: >> Totally unrelated to the problem. It seems, so far as I was able to >> characterize, to happen to daemons which are *swapped out* at the time >> of the memory shortage. If it's active enough to still be in core, it >> doesn't get spammed. >> LC> I went through swap_pager.c today and found a problem that could potentially LC> have bad consequences. It's a comparison between page index in the swap pager LC> and the size of the vm object, since a shadowed object may have a non-zero LC> paging offset with respect to the swap pager, the comparison should have taken LC> the offset into account. This piece of code has been there since '95, so LC> I can't say if this was responsible for the daemon dying problem. It is definitely not responsible. At least for this particular problem, though it may fix something else ;) After applying the patch, and artificially exhausting memory, I promptly got: Nov 10 03:15:34 grape /kernel: swap_pager: suggest more swap space: 61 MB Nov 10 03:16:26 grape /kernel: pid 310 (sendmail), uid 0: exited on signal 11 Nov 10 03:17:26 grape /kernel: pid 311 (sendmail), uid 0: exited on signal 11 Nov 10 03:18:25 grape /kernel: pid 313 (sendmail), uid 0: exited on signal 11 Nov 10 03:19:25 grape /kernel: pid 353 (sendmail), uid 0: exited on signal 11 Nov 10 03:20:26 grape /kernel: pid 394 (sendmail), uid 0: exited on signal 11 LC> -lq LC> Index: swap_pager.c LC> =================================================================== LC> RCS file: /home/ncvs/src/sys/vm/swap_pager.c,v LC> retrieving revision 1.103 LC> diff -u -r1.103 swap_pager.c LC> --- swap_pager.c 1998/10/31 15:31:28 1.103 LC> +++ swap_pager.c 1998/11/09 11:02:54 LC> @@ -349,7 +349,7 @@ LC> *valid = 0; LC> ix = pindex / SWB_NPAGES; LC> if ((ix >= object->un_pager.swp.swp_nblocks) || LC> - (pindex >= object->size)) { LC> + (pindex >= object->size + OFF_TO_IDX(object->paging_offset))) { LC> return (FALSE); LC> } LC> swb = &object->un_pager.swp.swp_blocks[ix]; LC> @@ -1227,8 +1227,8 @@ LC> * intent of this code is to allocate small chunks for LC> * small objects) LC> */ LC> - if ((off == 0) && ((fidx + ntoget) > object->size)) { LC> - ntoget = object->size - fidx; LC> + if ((off == 0) && ((fidx + ntoget) > object->size + paging_pindex)) { LC> + ntoget = object->size + paging_pindex - fidx; LC> } LC> retrygetspace: LC> if (!swap_pager_full && ntoget > 1 && --- We are the people our parents warned us about. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message