From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 23:53:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B68C106566C; Mon, 13 Dec 2010 23:53:56 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3974B8FC17; Mon, 13 Dec 2010 23:53:56 +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 oBDNruHL097419; Mon, 13 Dec 2010 23:53:56 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDNruQX097416; Mon, 13 Dec 2010 23:53:56 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201012132353.oBDNruQX097416@svn.freebsd.org> From: Kirk McKusick Date: Mon, 13 Dec 2010 23:53:56 +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: r216421 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 23:53:56 -0000 Author: mckusick Date: Mon Dec 13 23:53:55 2010 New Revision: 216421 URL: http://svn.freebsd.org/changeset/base/216421 Log: Tighten up some of the comments describing turnstiles and sleepqueues. No code changes. Reviewed by: John Baldwin Modified: head/sys/sys/sleepqueue.h head/sys/sys/turnstile.h Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Mon Dec 13 23:30:56 2010 (r216420) +++ head/sys/sys/sleepqueue.h Mon Dec 13 23:53:55 2010 (r216421) @@ -49,7 +49,7 @@ * call sleepq_set_timeout() after sleepq_add() to setup a timeout. It * should then use one of the sleepq_timedwait() functions to block. * - * If the thread wants to the sleep to be interruptible by signals, it can + * If the thread wants the sleep to be interruptible by signals, it can * call sleepq_catch_signals() after sleepq_add(). It should then use * one of the sleepq_wait_sig() functions to block. After the thread has * been resumed, it should call sleepq_calc_signal_retval() to determine @@ -68,7 +68,7 @@ * sleepq_signal(). These routines each return a boolean that will be true * if at least one swapped-out thread was resumed. In that case, the caller * is responsible for waking up the swapper by calling kick_proc0() after - * releasing the sleep queeu chain lock. + * releasing the sleep queue chain lock. * * Each thread allocates a sleep queue at thread creation via sleepq_alloc() * and releases it at thread destruction via sleepq_free(). Note that Modified: head/sys/sys/turnstile.h ============================================================================== --- head/sys/sys/turnstile.h Mon Dec 13 23:30:56 2010 (r216420) +++ head/sys/sys/turnstile.h Mon Dec 13 23:53:55 2010 (r216421) @@ -39,13 +39,14 @@ * shared, or eread, lock, and one for threads waiting for an * exclusive, or write, lock. * - * A thread calls turnstile_lock() to lock the turnstile chain associated - * with a given lock. A thread calls turnstile_wait() when the lock is - * contested to be put on the queue and block. If a thread needs to retry - * a lock operation instead of blocking, it should call turnstile_release() - * to unlock the associated turnstile chain lock. + * A thread calls turnstile_chain_lock() to lock the turnstile chain + * associated with a given lock. A thread calls turnstile_wait() when + * the lock is contested to be put on the queue and block. If a thread + * calls turnstile_trywait() and decides to retry a lock operation instead + * of blocking, it should call turnstile_cancel() to unlock the associated + * turnstile chain lock. * - * When a lock is released, the thread calls turnstile_lookup() to loop + * When a lock is released, the thread calls turnstile_lookup() to look * up the turnstile associated with the given lock in the hash table. Then * it calls either turnstile_signal() or turnstile_broadcast() to mark * blocked threads for a pending wakeup. turnstile_signal() marks the @@ -55,7 +56,7 @@ * releasing the lock, turnstile_unpend() must be called to wake up the * pending thread(s) and give up ownership of the turnstile. * - * Alternatively, if a thread wishes to relinquish ownership of a thread + * Alternatively, if a thread wishes to relinquish ownership of a lock * without waking up any waiters, it may call turnstile_disown(). * * When a lock is acquired that already has at least one thread contested