From owner-freebsd-current@freebsd.org Tue Jan 23 12:39:51 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBECEED184E for ; Tue, 23 Jan 2018 12:39:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A05BD7976E; Tue, 23 Jan 2018 12:39:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 42D5626009E; Tue, 23 Jan 2018 13:39:48 +0100 (CET) Subject: Re: Periodical interrupt storm when playing game with USB keyboard To: Johannes Lundberg , blubee blubeeme Cc: Adrian Chadd , Ian Lepore , freebsd-current References: <64218617-98d2-0e6e-5872-e44106e61bf7@selasky.org> <1516569725.42536.99.camel@freebsd.org> <0aceb3ff-4938-1b29-d493-d83ce82cc853@selasky.org> From: Hans Petter Selasky Message-ID: Date: Tue, 23 Jan 2018 13:36:56 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 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: Tue, 23 Jan 2018 12:39:52 -0000 On 01/23/18 12:27, Johannes Lundberg wrote: > Hi all > > Some quick dtracing with play causing lag, vs play not causing lag (that is > not hold down any key on a usb keyboard for too long). > > Hi, The only thing I can think about is that one or more of kb_delay1 or kb_delay2 are zero: sys/dev/usb/input/ukbd.c > case KDSETREPEAT: /* set keyboard repeat rate (new > * interface) */ > if (!KBD_HAS_DEVICE(kbd)) { > return (0); > } > /* > * Convert negative, zero and tiny args to the same limits > * as atkbd. We could support delays of 1 msec, but > * anything much shorter than the shortest atkbd value > * of 250.34 is almost unusable as well as incompatible. > */ > kbd->kb_delay1 = imax(((int *)arg)[0], 250); > kbd->kb_delay2 = imax(((int *)arg)[1], 34); > #ifdef EVDEV_SUPPORT > if (sc->sc_evdev != NULL) > evdev_push_repeats(sc->sc_evdev, kbd); > #endif > return (0); Can you add some prints in ukbd.c where kb_delayX are set and see if their value are zero? Lowest supported value should be 1. --HPS