From owner-cvs-all Tue Dec 31 11:38: 6 2002 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 54B0137B401; Tue, 31 Dec 2002 11:38:05 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15CAE43EA9; Tue, 31 Dec 2002 11:38:05 -0800 (PST) (envelope-from alc@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gBVJc4fh039212; Tue, 31 Dec 2002 11:38:04 -0800 (PST) (envelope-from alc@repoman.freebsd.org) Received: (from alc@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBVJc43Y039211; Tue, 31 Dec 2002 11:38:04 -0800 (PST) Message-Id: <200212311938.gBVJc43Y039211@repoman.freebsd.org> From: Alan Cox Date: Tue, 31 Dec 2002 11:38:04 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/vm vm_map.c vm_map.h X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG alc 2002/12/31 11:38:04 PST Modified files: sys/vm vm_map.c vm_map.h Log: Implement a variant locking scheme for vm maps: Access to system maps is now synchronized by a mutex, whereas access to user maps is still synchronized by a lockmgr()-based lock. Why? No single type of lock, including sx locks, meets the requirements of both types of vm map. Sometimes we sleep while holding the lock on a user map. Thus, a a mutex isn't appropriate. On the other hand, both lockmgr()-based and sx locks release Giant when a thread/process blocks during contention for a lock. This could lead to a race condition in a legacy driver (that relies on Giant for synchronization) if it attempts to kmem_malloc() and fails to immediately obtain the lock. Fortunately, we never sleep while holding a system map lock. Revision Changes Path 1.278 +38 -16 src/sys/vm/vm_map.c 1.94 +1 -0 src/sys/vm/vm_map.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message