From owner-freebsd-stable@FreeBSD.ORG Fri Apr 18 19:05:10 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3170106566B; Fri, 18 Apr 2008 19:05:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id D10C88FC1D; Fri, 18 Apr 2008 19:05:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id 6AC9E1A4D8B; Fri, 18 Apr 2008 12:05:09 -0700 (PDT) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m3IJ4lQI068097; Fri, 18 Apr 2008 15:04:54 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Aristedes Maniatis Date: Fri, 18 Apr 2008 13:14:24 -0400 User-Agent: KMail/1.9.7 References: <77E81AD6-FBCC-4D30-A5CB-A9B918D4793F@ish.com.au> <200804101651.24852.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804181314.24974.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 18 Apr 2008 15:04:55 -0400 (EDT) X-Virus-Scanned: ClamAV 0.91.2/6831/Fri Apr 18 12:09:18 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: bzeeb+freebsd+lor@zabbadoz.net, jeff@freebsd.org, Jurgen Weber , freebsd-stable@freebsd.org, davidxu@freebsd.org Subject: Re: LOR sleepq/scrlock X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2008 19:05:10 -0000 On Thursday 10 April 2008 06:33:40 pm Aristedes Maniatis wrote: > > >> http://www.ish.com.au/s/LOR/1.jpg > >> http://www.ish.com.au/s/LOR/2.jpg > >> http://www.ish.com.au/s/LOR/3.jpg (this overlaps with [2]) > > > > These are all garbage in kuickshow. :( > > They work fine for me in Firefox. But don't know what sort of jpegs > the Sony camera saves. Anyhow I've also now resaved them as png (about > twice the size). Please let me know if that worked. > > http://www.ish.com.au/s/LOR/1.png , etc kuickshow had issues still, but FF worked ok. The specific LOR at the end is real, but a minor one. Basically, the console driver locks (e.g. "sio", "scrlock") are higher in the order than the various thread locks, so any printf while holding a thread lock will trigger a LOR. The real problem at the bottom of the screen though is a real issue. It's a LOR of two different sleepqueue chain locks. The problem is that when setrunnable() encounters a swapped out thread it tries to wakeup proc0, but if proc0 is asleep (which is typical) then its thread lock is a sleep queue chain lock, so waking up a swapped out thread from wakeup() will usually trigger this LOR. I think the best fix is to not have setrunnable() kick proc0 directly. Perhaps setrunnable() should return an int and return true if proc0 needs to be awakened and false otherwise. Then the the sleepq code (b/c only sleeping threads can be swapped out anyway) can return that value from sleepq_resume_thread() and can call kick_proc0() directly once it has dropped all of its own locks. -- John Baldwin