From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 13 22:03:07 2014 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3D6EBD1; Thu, 13 Feb 2014 22:03:07 +0000 (UTC) Received: from mail-ob0-x229.google.com (mail-ob0-x229.google.com [IPv6:2607:f8b0:4003:c01::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8CBD8191E; Thu, 13 Feb 2014 22:03:07 +0000 (UTC) Received: by mail-ob0-f169.google.com with SMTP id wo20so12938202obc.14 for ; Thu, 13 Feb 2014 14:03:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gJfIorT/xkjI5tRi+l3HulWAnKbYYgusrWZ/48Kbc8o=; b=EbD/wXWJgm3/MwOqLNDXrrZDR2D3L6kixDRyGjFl2I9I0y31Luz61MFmv7t4B4GTNs i0M+3AZh50M/Dsu81wNe716+y0tqoJ1dhwx4oo34Yo42Xv74Z3lYzmLe3OXxwi9uAocV BQXYeNRmTOp5rrhw5CG9KE7YoPnja7S1B3W121mdcs5zvIOPw5EfPNQm1reOcEHMM8q3 vbof86l4n976wBGJ0t9f8iqpy9s4KWN4w8ZQqE1YdWRZui4YLw1Eql5AjxXYC7m6EXLL Iro7OcACSEPynqjZJ8Y7d3CoTTuJatqWKbsz6gz645Kr2Ku7O4NaBj6b6+JYBIHHQD2S Emtg== MIME-Version: 1.0 X-Received: by 10.60.62.243 with SMTP id b19mr3280180oes.42.1392328986737; Thu, 13 Feb 2014 14:03:06 -0800 (PST) Received: by 10.76.130.196 with HTTP; Thu, 13 Feb 2014 14:03:06 -0800 (PST) In-Reply-To: <1392325587.1145.96.camel@revolution.hippie.lan> References: <52FD30D9.6050604@mu.org> <1392325587.1145.96.camel@revolution.hippie.lan> Date: Thu, 13 Feb 2014 17:03:06 -0500 Message-ID: Subject: Re: Debugging rw lock From: Ryan Stone To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-hackers@freebsd.org" , Vijay Singh X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Feb 2014 22:03:07 -0000 On Thu, Feb 13, 2014 at 4:06 PM, Ian Lepore wrote: > Does option DEADLKRES not work with rwlocks? (I've never used it, just > seen it in the NOTES). > > -- Ian DEADLKRES will panic the system after a thread has been blocked for a timeout period (I think that it's something ridiculous like 30 minutes). However it's of no use when trying to debugging a leaked read lock, because the thread that lost the lock will have left behind no clues as to it's identity. If you have some kind of reproduction scenario, the quickest hack that might get you an answer would be to change INP_INFO_RLOCK to actually take a wlock instead. Rather than instrumenting the code, you could use the dtrace lockstat provider to log every lock/unlock and post-process the output to find the culprit. Make sure that you have r258541 if you want to use lockstat. http://svnweb.freebsd.org/changeset/base/258541