From owner-cvs-all@FreeBSD.ORG Tue Jun 15 01:02:01 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F45616A4CE; Tue, 15 Jun 2004 01:02:01 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0813643D48; Tue, 15 Jun 2004 01:02:01 +0000 (GMT) (envelope-from green@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5F120qc078305; Tue, 15 Jun 2004 01:02:00 GMT (envelope-from green@repoman.freebsd.org) Received: (from green@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5F120XG078301; Tue, 15 Jun 2004 01:02:00 GMT (envelope-from green) Message-Id: <200406150102.i5F120XG078301@repoman.freebsd.org> From: Brian Feldman Date: Tue, 15 Jun 2004 01:02:00 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/vm vm_contig.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2004 01:02:01 -0000 green 2004-06-15 01:02:00 UTC FreeBSD src repository Modified files: sys/vm vm_contig.c Log: Make contigmalloc() more reliable: 1. Remove a race whereby contigmalloc() would deadlock against the running processes in the system if they kept reinstantiating the memory on the active and inactive page queues that it was trying to flush out. The process doing the contigmalloc() would sit in "swwrt" forever and the swap pager would be going at full force, but never get anywhere. Instead of doing it until the queues are empty, launder for as many iterations as there are pages in the queue. 2. Do all laundering to swap synchronously; previously, the vnode laundering was synchronous and the swap laundering not. 3. Increase the number of launder-or-allocate passes to three, from two, while failing without bothering to do all the laundering on the third pass if allocation was not possible. This effectively gives exactly two chances to launder enough contiguous memory, helpful with high memory churn where a lot of memory from one pass to the next (and during a single laundering loop) becomes dirtied again. I can now reliably hot-plug hardware requiring a 256KB contigmalloc() without having the kldload/cbb ithread sit around failing to make progress, while running a busy X session. Previously, it took killing X to get contigmalloc() to get further (that is, quiescing the system), and even then contigmalloc() returned failure. Revision Changes Path 1.35 +25 -6 src/sys/vm/vm_contig.c