From owner-svn-src-all@FreeBSD.ORG Mon Aug 3 09:57:21 2009 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 0A963106566C; Mon, 3 Aug 2009 09:57:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D57C18FC14; Mon, 3 Aug 2009 09:57:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7145D46B17; Mon, 3 Aug 2009 05:57:20 -0400 (EDT) Date: Mon, 3 Aug 2009 10:57:20 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Hans Petter Selasky In-Reply-To: <200908031129.06315.hselasky@c2i.net> Message-ID: References: <200908030923.12867.hselasky@c2i.net> <20090803082838.GE1292@hoeg.nl> <200908031129.06315.hselasky@c2i.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , Navdeep Parhar , svn-src-head@freebsd.org Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input (regression patch) 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: Mon, 03 Aug 2009 09:57:21 -0000 On Mon, 3 Aug 2009, Hans Petter Selasky wrote: > On Monday 03 August 2009 10:28:38 Ed Schouten wrote: >> * Robert Watson wrote: >>> I'm a bit surprised the timed key repeat in this patch would work properly >>> in DDB, as microtime(9) relies on interrupts firing for updated >>> timestamps. The availability of interrupts for polled input consumers >>> varies, but in general this is not true (for example) at the DDB command >>> prompt. Does this code work correctly when time stands still? >> >> Apart from that, who gives a *beep* about keyboard repeat while inside the >> debugger. I have to confess it would be irritating to press backspace >> multiple times, instead of holding the key pressed, but still, it's not >> worth it. > > I think getmicrotime relies on interrupts, while microtime doesn't. > > See "man microtime". You're right, but that doesn't make things better :-). Some of the tc_get_timecount() calls are safe in the DDB environment, but several are not. In particular, tick_get_timecount_mp() and i8254_get_timecount() both acquire locks, the former the thread scheduler lock, and the latter a dedicated spinlock. This produces the opportunity for rather nasty deadlocks in DDB, especially tick_get_timecount_mp() on sparc64. This was the bug I was actually looking for in your patch, but then misread microtime() and concluded you had a different one. :-) I would much rather not have DDB rely on, for example, not contending thread_lock(), than have key repeat in DDB. Robert N M Watson Computer Laboratory University of Cambridge