From owner-freebsd-current@FreeBSD.ORG Sun Apr 20 12:10:32 2003 Return-Path: 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 9E00E37B404 for ; Sun, 20 Apr 2003 12:10:32 -0700 (PDT) Received: from HAL9000.homeunix.com (12-233-57-131.client.attbi.com [12.233.57.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3DD843FAF for ; Sun, 20 Apr 2003 12:10:31 -0700 (PDT) (envelope-from das@freebsd.org) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.5) with ESMTP id h3KJAT8M004943; Sun, 20 Apr 2003 12:10:29 -0700 (PDT) (envelope-from das@freebsd.org) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.5/Submit) id h3KJATLb004942; Sun, 20 Apr 2003 12:10:29 -0700 (PDT) (envelope-from das@freebsd.org) Date: Sun, 20 Apr 2003 12:10:29 -0700 From: David Schultz To: Matthew Dillon Message-ID: <20030420191029.GA4803@HAL9000.homeunix.com> Mail-Followup-To: Matthew Dillon , Bruce Evans , freebsd-current@freebsd.org References: <000501c30682$4e5e64b0$6601a8c0@VAIO650> <20030420002940.GB46590@HAL9000.homeunix.com> <20030420191744.G19683@gamplex.bde.org> <20030420101401.GA2821@HAL9000.homeunix.com> <200304201828.h3KISlKq090099@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200304201828.h3KISlKq090099@apollo.backplane.com> cc: freebsd-current@freebsd.org Subject: Re: Broken memory management on system with no swap X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Sun, 20 Apr 2003 19:10:33 -0000 On Sun, Apr 20, 2003, Matthew Dillon wrote: > Hmm. It sounds like this program is using mmap() to dirty pages and > that the VM system is not flushing them out quickly enough to avoid > running out of memory. This could happen if the program dirties > a significant portion of memory all at once. The pageout daemon would > wind up doing a priority requeue of the dirty pages (line 848 of > vm_pageout.c) and 'miss' flushing any of them out to the filesystem > in the first pass. The result would be that the system would believe > it has run out of memory for a short period of time. Thanks for your analysis. I thought there might be a GBDE-related factor when Lucky mentioned that copying a file triggers the bug, since cp(1) turns off mmap() mode for files > 8 MB to avoid this sort of thing. But nevertheless, I can see how the situation you describe can occur, where the system realizes too late that all of the reclaimable pages are tied up in the active queue. > I suggest changing this: > > if ((vm_swap_size < 64 && vm_page_count_min()) || > (swap_pager_full && vm_paging_target() > 0)) { > > To this: > > if (pass != 0 && > ((vm_swap_size < 64 && vm_page_count_min()) || > (swap_pager_full && vm_paging_target() > 0))) { Sounds reasonable. I would be happy to look into this next month if nobody else is interested. I would want to ensure that this change cannot result in deadlock.