From owner-svn-src-head@FreeBSD.ORG Fri Jun 28 15:55:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 365CBFD6; Fri, 28 Jun 2013 15:55:31 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28D3C15C5; Fri, 28 Jun 2013 15:55:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5SFtVUC006406; Fri, 28 Jun 2013 15:55:31 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5SFtVOv006405; Fri, 28 Jun 2013 15:55:31 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201306281555.r5SFtVOv006405@svn.freebsd.org> From: Ryan Stone Date: Fri, 28 Jun 2013 15:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252342 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 28 Jun 2013 15:55:31 -0000 Author: rstone Date: Fri Jun 28 15:55:30 2013 New Revision: 252342 URL: http://svnweb.freebsd.org/changeset/base/252342 Log: Correct a bug that prevented deadlkres from (almost) ever firing. deadlkres was using a reversed test to check whether ticks had rolled over. This meant that deadlkres could only fire after ticks had rolled over. This test was actually unnecessary as deadlkres only ever took the difference of ticks values which is safe even in the presence of ticks rollover. Remove the tests entirely. Now deadlkres will properly fire after a lock has been held after the timeout period. MFC after: 1 month Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Fri Jun 28 14:41:06 2013 (r252341) +++ head/sys/kern/kern_clock.c Fri Jun 28 15:55:30 2013 (r252342) @@ -216,13 +216,8 @@ deadlkres(void) } FOREACH_THREAD_IN_PROC(p, td) { - /* - * Once a thread is found in "interesting" - * state a possible ticks wrap-up needs to be - * checked. - */ thread_lock(td); - if (TD_ON_LOCK(td) && ticks < td->td_blktick) { + if (TD_ON_LOCK(td)) { /* * The thread should be blocked on a @@ -247,8 +242,7 @@ deadlkres(void) __func__, td, tticks); } } else if (TD_IS_SLEEPING(td) && - TD_ON_SLEEPQ(td) && - ticks < td->td_blktick) { + TD_ON_SLEEPQ(td)) { /* * Check if the thread is sleeping on a