From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 13 20:59:11 2014 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBB18132 for ; Thu, 13 Feb 2014 20:59:11 +0000 (UTC) Received: from mail-oa0-x235.google.com (mail-oa0-x235.google.com [IPv6:2607:f8b0:4003:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 815BE1312 for ; Thu, 13 Feb 2014 20:59:11 +0000 (UTC) Received: by mail-oa0-f53.google.com with SMTP id m1so13121369oag.26 for ; Thu, 13 Feb 2014 12:59:10 -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=3zVQFsIxlYn6QYaAj7efkFGmy3ozRk0tKmfF2w90yiQ=; b=upBN/pLjyqc179lqqkTiyS1bnlFwuJ9poKXCgpmBT4p285BoeFY2BcMFR87649+qv5 LOgtpDmsphHG2cIxDAxPL3/QuG/7XPbmPk95G3MeGOKPZrNxNuE+gTC9XHHfvWnk6OcB ojvBslXHR06iN4bfkYbc7ss3hymRHIKWeDza0ySblegLp0FBTe6+BemtFuoZWe7zRX4+ +ERD7gzf0nAoqsCAo1d97zWHVChFrK02XwikECmkA/UlWoCaLw1bxX+sypb3NeLl507z 5k8O+TKZPjsJI7EFvR0O8HF4GnrjrK/FJxGVLWgRq0VF2Ra0SjWiT+vJcQeVHlbPGX1H N4xw== MIME-Version: 1.0 X-Received: by 10.182.53.72 with SMTP id z8mr3036252obo.36.1392325150681; Thu, 13 Feb 2014 12:59:10 -0800 (PST) Received: by 10.182.74.4 with HTTP; Thu, 13 Feb 2014 12:59:10 -0800 (PST) In-Reply-To: <52FD30D9.6050604@mu.org> References: <52FD30D9.6050604@mu.org> Date: Thu, 13 Feb 2014 12:59:10 -0800 Message-ID: Subject: Re: Debugging rw lock From: Vijay Singh To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: hackers@freebsd.org 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 20:59:11 -0000 You're talking about instrumenting the code, right? But which thread? I was thinking of augmenting the rw lock to record the readers, but wanted to check if something is possible without instrumentation. On Thu, Feb 13, 2014 at 12:53 PM, Alfred Perlstein wrote: > Keep a stack of rwlocks owned in the struct thread. > > -Alfred > > On 2/13/14, 12:51 PM, Vijay Singh wrote: > >> I am running into an issue where an rw lock is read locked and never >> unlocked, and causes a system to livelock. I was wondering if its possible >> to figure out which thread owns the read lock? >> >> It's the tcp pcbinfo lock. >> >> (kgdb-amd64-7.4-08) show_rwlock rw >> name : tcp >> class: rw >> flags: {SLEEP, INITED, WITNESS, RECURSE, UPGRADABLE} >> state: RLOCK: 1 locks >> waiters: writers >> >> Any help is appreciated. >> >> -vijay >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org >> " >> >> >