From owner-cvs-all@FreeBSD.ORG Wed Jul 21 23:56:09 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 567F216A4CE; Wed, 21 Jul 2004 23:56:09 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 505E343D39; Wed, 21 Jul 2004 23:56:09 +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 i6LNu9rF076389; Wed, 21 Jul 2004 23:56:09 GMT (envelope-from green@repoman.freebsd.org) Received: (from green@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i6LNu9Z6076388; Wed, 21 Jul 2004 23:56:09 GMT (envelope-from green) Message-Id: <200407212356.i6LNu9Z6076388@repoman.freebsd.org> From: Brian Feldman Date: Wed, 21 Jul 2004 23:56:09 +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_page.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: Wed, 21 Jul 2004 23:56:09 -0000 green 2004-07-21 23:56:09 UTC FreeBSD src repository Modified files: sys/vm vm_page.c Log: Fix a race in vm_page_sleep_if_busy(). Due to vm_object locking being incomplete, it currently has to know how to drop and pick back up the vm_object's mutex if it has to sleep and drop the page queue mutex. The problem with this is that if the page is busy, while we are sleeping, the page can be freed and object disappear. When trying to lock m->object, we'd get a stale or NULL pointer and crash. The object is now cached, but this makes the assumption that the object is referenced in some manner and will not itself disappear while it is unlocked. Since this only happens if the object is locked, I had to remove an assumption earlier in contigmalloc() that reversed the order of locking the object and doing vm_page_sleep_if_busy(), not the normal order. Revision Changes Path 1.289 +12 -4 src/sys/vm/vm_page.c