From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 01:19:01 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 91DDA106566B; Thu, 7 Jan 2010 01:19:01 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67B348FC1C; Thu, 7 Jan 2010 01:19:01 +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 o071J1t4098307; Thu, 7 Jan 2010 01:19:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o071J1V9098305; Thu, 7 Jan 2010 01:19:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201001070119.o071J1V9098305@svn.freebsd.org> From: Attilio Rao Date: Thu, 7 Jan 2010 01:19:01 +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: r201709 - head/sys/kern 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: Thu, 07 Jan 2010 01:19:01 -0000 Author: attilio Date: Thu Jan 7 01:19:01 2010 New Revision: 201709 URL: http://svn.freebsd.org/changeset/base/201709 Log: Tweak comments. Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Thu Jan 7 01:10:49 2010 (r201708) +++ head/sys/kern/kern_lock.c Thu Jan 7 01:19:01 2010 (r201709) @@ -277,6 +277,11 @@ wakeupshlk(struct lock *lk, const char * * avoid a starvation for the threads sleeping on the shared * queue by giving them precedence and cleaning up the * exclusive waiters bit anyway. + * Please note that lk_exslpfail count may be lying about + * the real number of waiters with the LK_SLEEPFAIL flag on + * because they may be used in conjuction with interruptible + * sleeps so lk_exslpfail is consider as a 'upper limit' + * bound, considering the edge cases. */ realexslp = sleepq_sleepcnt(&lk->lock_object, SQ_EXCLUSIVE_QUEUE); @@ -943,6 +948,12 @@ __lockmgr_args(struct lock *lk, u_int fl * empty avoid a starvation for the threads sleeping * on the shared queue by giving them precedence * and cleaning up the exclusive waiters bit anyway. + * Please note that lk_exslpfail count may be lying + * about the real number of waiters with the + * LK_SLEEPFAIL flag on because they may be used in + * conjuction with interruptible sleeps so + * lk_exslpfail is consider as a 'upper limit' bound, + * considering the edge cases. */ MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); realexslp = sleepq_sleepcnt(&lk->lock_object, @@ -1046,6 +1057,13 @@ __lockmgr_args(struct lock *lk, u_int fl * threads sleeping on the shared queue by * giving them precedence and cleaning up the * exclusive waiters bit anyway. + * Please note that lk_exslpfail count may be + * lying about the real number of waiters with + * the LK_SLEEPFAIL flag on because they may + * be used in conjuction with interruptible + * sleeps so lk_exslpfail is consider as a + * 'upper limit' bound, considering the edge + * cases. */ if (v & LK_EXCLUSIVE_WAITERS) { queue = SQ_EXCLUSIVE_QUEUE;