From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 17:02:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D63E4106566C; Wed, 10 Feb 2010 17:02:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5EF18FC0A; Wed, 10 Feb 2010 17:02:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AH26Ve052467; Wed, 10 Feb 2010 17:02:06 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AH26HA052465; Wed, 10 Feb 2010 17:02:06 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002101702.o1AH26HA052465@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 10 Feb 2010 17:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203759 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 17:02:06 -0000 Author: trasz Date: Wed Feb 10 17:02:06 2010 New Revision: 203759 URL: http://svn.freebsd.org/changeset/base/203759 Log: Improve description for Giant and mention blocking inside interrupt threads. Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Wed Feb 10 16:30:04 2010 (r203758) +++ head/share/man/man9/locking.9 Wed Feb 10 17:02:06 2010 (r203759) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2010 +.Dd February 10, 2010 .Dt LOCKING 9 .Os .Sh NAME @@ -191,13 +191,16 @@ Giant is an instance of a mutex, with so .It It is recursive. .It -Drivers can request that Giant be locked around them, but this is -going away. -.It -You can sleep while it has recursed, but other recursive locks cannot. +Drivers and filesystems can request that Giant be locked around them +by not marking themselves MPSAFE. Note that infrastructure to do this +is slowly going away as non-MPSAFE drivers either became properly locked +or disappear. .It Giant must be locked first before other locks. .It +It is OK to hold Giant while performing unbounded sleep; in such case, +Giant will be dropped before sleeping and picked up after wakeup. +.It There are places in the kernel that drop Giant and pick it back up again. Sleep locks will do this before sleeping. @@ -315,6 +318,9 @@ If any caller above you has any mutex or rwlock, your sleep, will cause a panic. If the sleep only happens rarely it may be years before the bad code path is found. +.Pp +It is an error to do any operation that could result in unbounded sleep when +running inside an interrupt thread. .Ss Interaction table The following table shows what you can and can not do if you hold one of the synchronization primitives discussed here: