From owner-freebsd-current@FreeBSD.ORG Thu Nov 6 23:09:40 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5898916A4CE for ; Thu, 6 Nov 2003 23:09:40 -0800 (PST) Received: from smtp.mho.com (smtp.mho.net [64.58.4.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 690CA43FE5 for ; Thu, 6 Nov 2003 23:09:37 -0800 (PST) (envelope-from scottl@freebsd.org) Received: (qmail 10626 invoked by uid 1002); 7 Nov 2003 07:09:36 -0000 Received: from unknown (HELO freebsd.org) (64.58.1.252) by smtp.mho.net with SMTP; 7 Nov 2003 07:09:36 -0000 Message-ID: <3FAB4507.9020603@freebsd.org> Date: Fri, 07 Nov 2003 00:08:55 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031103 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Morten Johansen References: <3FA966B2.9040704@morten-johansen.net> <20031105202947.A43448@pooker.samsco.home> <3FAA2CEB.6000403@morten-johansen.net> <3FAAF50B.9030105@morten-johansen.net> In-Reply-To: <3FAAF50B.9030105@morten-johansen.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-current@freebsd.org Subject: Re: the PS/2 mouse problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2003 07:09:40 -0000 Morten Johansen wrote: > Morten Johansen wrote: > >> Scott Long wrote: >> >>> One thought that I had was to make psmintr() be INTR_FAST. I need to >>> stare at the code some more to fully understand it, but it looks like it >>> wouldn't be all that hard to do. Basically just use the interrupt >>> handler >>> to pull all of the data out of the hardware and into a ring buffer in >>> memory, and then a fast taskqueue to process that ring buffer. It would >>> at least answer the question of whether the observed problems are due to >>> ithread latency. And if done right, no locks would be needed in >>> psmintr(). >>> >>> Scott >> >> >> >> >> I can reproduce the problem consistently on my machine, by moving the >> mouse around, while executing e.g this command in a xterm: >> >> dd if=/dev/zero of=test bs=32768 count=4000; sync; sync; sync >> >> when the sync'ing sets in the mouse attacks. >> It is very likely due to interrupt latency. >> >> I'd be happy to test any clever patches. >> >> >> Morten >> >> > > > Wow. You are completly right! > By using a MTX_SPIN mutex instead, and marking the interrupt handler > INTR_MPSAFE | INTR_FAST, my problem goes away. > I am no longer able to reproduce the mouse attack. > I have not noticed any side-effects of this. Could there be any? > I will file a PR with an updated patch, unless you think it's a better > idea to rearrange the driver. > Probably the locking could be done better anyway. > > > Morten > > > Great! By all means, please submit a PR and assign it to me. Scott