From owner-freebsd-current@freebsd.org Sun Jan 21 20:36:07 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 8446FEB9991 for ; Sun, 21 Jan 2018 20:36:07 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 180C87B3C4 for ; Sun, 21 Jan 2018 20:36:07 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id r78so13133807wme.0 for ; Sun, 21 Jan 2018 12:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RCUIibq8/HZDU2m89IMHJzRbE0wMFHS8a0DdJX44kvk=; b=tbN/JX/ZbFKCDfKR6LB5MARHn+cMyTIihbrnKvCRTtR7r2jjXGQbauVnMLwbn94fh5 p2V9MFRFSdVEnZDXoYkAZl3t69zowRparaTd9lVrkyp68TFRRqgzHpQgqqxp1wCVdg8X +kMtOUKxFV8apAHz+HEkRoCrPYLaO+Qe62EKZsJB8JlpPwyNs89TIw/3e212lwZRcEtp A/7RhhStsuvC0aAxWe+NPqlwdbahdwC3no9WxEhUGoLQ3tgYH0co9u/lb0XsKiKu/uNq h4fb+6zQq2wL28acjilPMxpl9H3vwtuBqrBxPsZTs1vykTyqi8aTiA0/K7mUdtwQRLKG SUEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RCUIibq8/HZDU2m89IMHJzRbE0wMFHS8a0DdJX44kvk=; b=B/vVZUv6N8xzN+g6fiS2g3dUAWSHiU2Z3od+GFRWRRqDxgCKt/A7X/RqR7Ge1WyL7R CPP4i8vfbzmBwb1XDGgj8MN2MVoww5RTTQmRIVSnaaPs1D1g4MgE4CL/9dXqjIDWBpHk KUAl6UH5ow4UWhLEiMmf6l4MBwgaTCI1RQ+oQTQDJQ4d4YLg/hvUIp1+2E6pSOh8EH7k bCr3/9a6+FnsQ3q/GXYAXED+riwYOOvbgsceinC+xVWnBi+Fe1Fh/dQE24eo2Xhoc+W5 0cEOViP8hLoaC9SDvSuyn7sDqdtau3xXzDERxcx8HauY7INYA3WJS1nzEEOpIZ7lY42h D8xw== X-Gm-Message-State: AKwxytfdiSA4HVUhFQjohfDLorFlf77V0rCpwIzHsxNDnRUEWM5LJf6Z 393OCbWWAo/QFF2gsIkzDWQSPxrH3wF9fJa90UF6vA== X-Google-Smtp-Source: AH8x226Lr2j/vcWTOc5+W+Q5RomnB/AvKikBpaBf5/DsceepBnojxcjqIXJY1HNn9Q5DLjgB2MLYU29f+Q1a7ovtgyI= X-Received: by 10.28.101.196 with SMTP id z187mr3613647wmb.29.1516566965006; Sun, 21 Jan 2018 12:36:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.136.187 with HTTP; Sun, 21 Jan 2018 12:35:24 -0800 (PST) In-Reply-To: References: From: Johannes Lundberg Date: Sun, 21 Jan 2018 20:35:24 +0000 Message-ID: Subject: Re: Periodical interrupt storm when playing game with USB keyboard To: Hans Petter Selasky Cc: freebsd-current Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 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: Sun, 21 Jan 2018 20:36:07 -0000 Sending the same again, this time cc the list. On Sun, Jan 21, 2018 at 7:34 PM, Hans Petter Selasky wrote: > On 01/21/18 16:41, Johannes Lundberg wrote: > >> Hi >> >> Finally I found the root to the problem that's been having me puzzled fo= r >> the last week. >> >> I started playing UT2004 on my laptop while away from home. Worked >> perfectly. When I'm home and connect external display+mouse/keyboard, I >> get >> weird random lag. >> >> It is intr process that goes up to 100% CPU usage (swi4: clock) for a >> couple of seconds every 30 seconds or so, but only when I'm moving aroun= d >> in the game. To move around you need to hold down any of the wasd-keys. >> >> Turns out, the interrupt storms only happen when I use my external >> keyboard, not with the laptop keyboard. >> >> The internal keyboard is: >> atkbdc0: port 0x60,0x64 irq 1 on acpi0 >> atkbd0: irq 1 on atkbdc0 >> >> and external (Microsoft sculpt ergonomic desktop): >> ugen0.2: at usbus0 >> ukbd0: > 2.00/7.97, addr 1> on usbus0 >> >> The game runs with a linux binary. 32/64bit both act the same. >> It uses libSDL-1.2 from /compat/linux/lib for rendering but not sure abo= ut >> input events. >> >> I tried lowering the key repeat rate both with xset and kbdcontrol but i= t >> has no effect. >> >> I don't have any wired USB keyboard to try with. >> >> Anyone have a clue to what's going on? >> >> Hardware is Dell Latitude E7270 >> with >> FreeBSD 12-CURRENT >> drm-next-kmod >> linux-c6 >> > > Hi, > > What does "vmstat -i" say? > Don=E2=80=99t remember the exact values now but it says cpu0:timer is getti= ng A LOT of interrupts. Like at least 10-50x the others. Otherwise normal. > > The issue can also be caused by a timer with a small or zero timeout. > > This can be checked by setting: > kern.eventtimer.periodic=3D1 > > in /boot/loader.conf and rebooting. > Wow, kern.eventtimer.periodic=3D1 really made all the difference. No problem at all now and all cpu timers have equal interrupt total and rate. What does kern.eventtimer.periodic do? The sysctl description wasn't that elaborate... > --HPS >