From owner-cvs-all@FreeBSD.ORG Wed Feb 15 22:29:53 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org 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 8753C16A420; Wed, 15 Feb 2006 22:29:53 +0000 (GMT) (envelope-from ups@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55EED43D48; Wed, 15 Feb 2006 22:29:53 +0000 (GMT) (envelope-from ups@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k1FMTrrc052156; Wed, 15 Feb 2006 22:29:53 GMT (envelope-from ups@repoman.freebsd.org) Received: (from ups@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k1FMTrE8052155; Wed, 15 Feb 2006 22:29:53 GMT (envelope-from ups) Message-Id: <200602152229.k1FMTrE8052155@repoman.freebsd.org> From: Stephan Uphoff Date: Wed, 15 Feb 2006 22:29:53 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/vm vm_page.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 15 Feb 2006 22:29:53 -0000 ups 2006-02-15 22:29:53 UTC FreeBSD src repository Modified files: sys/vm vm_page.c Log: When the VM needs to allocated physical memory pages (for non interrupt use) and it has not plenty of free pages it tries to free pages in the cache queue. Unfortunately freeing a cached page requires the locking of the object that owns the page. However in the context of allocating pages we may not be able to lock the object and thus can only TRY to lock the object. If the locking try fails the cache page can not be freed and is activated to move it out of the way so that we may try to free other cache pages. If all pages in the cache belong to objects that are currently locked the cache queue can be emptied without freeing a single page. This scenario caused two problems: 1) vm_page_alloc always failed allocation when it tried freeing pages from the cache queue and failed to do so. However if there are more than cnt.v_interrupt_free_min pages on the free list it should return pages when requested with priority VM_ALLOC_SYSTEM. Failure to do so can cause resource exhaustion deadlocks. 2) Threads than need to allocate pages spend a lot of time cleaning up the page queue without really getting anything done while the pagedaemon needs to work overtime to refill the cache. This change fixes the first problem. (1) Reviewed by: tegge@ Revision Changes Path 1.313 +13 -3 src/sys/vm/vm_page.c