Re: Periodical interrupt storm when playing game with USB keyboard

2018-01-21 Thread Johannes Lundberg
On Sun, Jan 21, 2018 at 9:22 PM, Ian Lepore  wrote:

> On Sun, 2018-01-21 at 22:07 +0100, Hans Petter Selasky wrote:
> > On 01/21/18 21:45, Johannes Lundberg wrote:
> > >
> > > What does kern.eventtimer.periodic do?  The sysctl description
> > > wasn't
> > > that elaborate...
> > It turns off re-programming the timer every time there is a new
> > callout
> > with earlier completion time.
> >
> > --HPS
>
> Well, it does more than that.  It makes the system run "the old way"
> where there are periodic timer interrupts that happen whether they need
> to or not (bad for power saving), and there's no way to schedule
> anything to happen on intervals other than when the periodic ticks
> occur (so if kern.hz = 1000 and you ask to sleep for a microsecond you
> may actually sleep up to a millisecond).
>
>
Thanks for the further explanation.
I curious as to where the problem might be though.. It is the game's
binary-only Linux executable (Unreal Engine 2.5), Linux SDL 1.2, or on the
FreeBSD side? Haven't experienced anything similar with Quake3...
Switching to periodic timer feels like overkill but it does the job as a
work around.



> -- Ian
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Periodical interrupt storm when playing game with USB keyboard

2018-01-21 Thread Ian Lepore
On Sun, 2018-01-21 at 22:07 +0100, Hans Petter Selasky wrote:
> On 01/21/18 21:45, Johannes Lundberg wrote:
> > 
> > What does kern.eventtimer.periodic do?  The sysctl description
> > wasn't
> > that elaborate...
> It turns off re-programming the timer every time there is a new
> callout 
> with earlier completion time.
> 
> --HPS

Well, it does more than that.  It makes the system run "the old way"
where there are periodic timer interrupts that happen whether they need
to or not (bad for power saving), and there's no way to schedule
anything to happen on intervals other than when the periodic ticks
occur (so if kern.hz = 1000 and you ask to sleep for a microsecond you
may actually sleep up to a millisecond).

-- Ian
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Periodical interrupt storm when playing game with USB keyboard

2018-01-21 Thread Hans Petter Selasky

On 01/21/18 21:45, Johannes Lundberg wrote:

What does kern.eventtimer.periodic do?  The sysctl description wasn't
that elaborate...


It turns off re-programming the timer every time there is a new callout 
with earlier completion time.


--HPS
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Periodical interrupt storm when playing game with USB keyboard

2018-01-21 Thread Johannes Lundberg
On Sun, Jan 21, 2018 at 8:35 PM, Johannes Lundberg 
wrote:

> 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 for
>>> 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 around
>>> 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
>>> about
>>> input events.
>>>
>>> I tried lowering the key repeat rate both with xset and kbdcontrol but it
>>> 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’t remember the exact values now but it says cpu0:timer is getting 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=1
>>
>> in /boot/loader.conf and rebooting.
>>
>
> Wow, kern.eventtimer.periodic=1 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...
>

Replying myself. Found some explanation at
https://www.freebsd.org/cgi/man.cgi?query=eventtimers=0=0=FreeBSD+12-current=default=html

With periodic each cpu timer has an interrupt rate of 1999 while on one
shot it's around 700.
Maybe not a very power efficient and precise solution to the problem but it
works.



>
>
>> --HPS
>>
>
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Periodical interrupt storm when playing game with USB keyboard

2018-01-21 Thread Johannes Lundberg
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 for
>> 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 around
>> 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 about
>> input events.
>>
>> I tried lowering the key repeat rate both with xset and kbdcontrol but it
>> 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’t remember the exact values now but it says cpu0:timer is getting 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=1
>
> in /boot/loader.conf and rebooting.
>

Wow, kern.eventtimer.periodic=1 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
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Periodical interrupt storm when playing game with USB keyboard

2018-01-21 Thread Hans Petter Selasky

On 01/21/18 16:41, Johannes Lundberg wrote:

Hi

Finally I found the root to the problem that's been having me puzzled for
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 around
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:  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 about
input events.

I tried lowering the key repeat rate both with xset and kbdcontrol but it
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?

The issue can also be caused by a timer with a small or zero timeout.

This can be checked by setting:
kern.eventtimer.periodic=1

in /boot/loader.conf and rebooting.

--HPS
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: mounting UFS2 filesystem with access mode via fstab

2018-01-21 Thread Ian Lepore
On Sun, 2018-01-21 at 20:00 +0100, O. Hartmann wrote:
> Am Sun, 21 Jan 2018 18:15:11 +0100
> Gary Jennejohn  schrieb:
> 
> > 
> > On Sun, 21 Jan 2018 11:37:16 +0100
> > "O. Hartmann"  wrote:
> > 
> > > 
> > > Recently, I ran into the problem mounting a newly created /tmp,
> > > when I switched back
> > > from a tmpfs-backed /tmp to a UFS2/SSD/HDD backed /tmp. 
> > > 
> > > The convenience to set mode=01777 for the memory/tmpfs backed
> > > /tmp seems not to exist
> > > for UFS2 backed filesystems, since manpage mount(8) doesn't give
> > > me any option
> > > provided via -o which could accomplish what I can achieve with
> > > mode=, see man
> > > tmpfs(5).
> > > 
> > > Well, I guess I do miss something here or is this achievement
> > > reached on a different
> > > path I'm unaware of?
> > >   
> > chmod 1777 /tmp as root
> > 
> Well,
> that is the way we do it usually. But is there now way to perform the
> settings via fstab
> entry? Look at man  tmpfs, man mount_msdosfs, for instance, they
> provide options which
> can be put into the option column of fstab.
> 

You don't need to do it via the fstab, because the permissions are
persistent in the filesystem.  Just mount the filesystem on /tmp by
hand, then chmod  /tmp after mounting it and then it will
always have those permissions (wherever it is mounted).

With tmpfs there is no persistent storage to keep the permissions, so
there must be a way to set it from fstab.  With msdosfs there is no way
to store the unix-style permissions in the fs, so there must be a way
to set it from fstab.  For UFS, the mode is just stored in the fs.

-- Ian

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: mounting UFS2 filesystem with access mode via fstab

2018-01-21 Thread O. Hartmann
Am Sun, 21 Jan 2018 18:15:11 +0100
Gary Jennejohn  schrieb:

> On Sun, 21 Jan 2018 11:37:16 +0100
> "O. Hartmann"  wrote:
> 
> > Recently, I ran into the problem mounting a newly created /tmp, when I 
> > switched back
> > from a tmpfs-backed /tmp to a UFS2/SSD/HDD backed /tmp. 
> > 
> > The convenience to set mode=01777 for the memory/tmpfs backed /tmp seems 
> > not to exist
> > for UFS2 backed filesystems, since manpage mount(8) doesn't give me any 
> > option
> > provided via -o which could accomplish what I can achieve with mode=, see 
> > man
> > tmpfs(5).
> > 
> > Well, I guess I do miss something here or is this achievement reached on a 
> > different
> > path I'm unaware of?
> >   
> 
> chmod 1777 /tmp as root
> 

Well,
that is the way we do it usually. But is there now way to perform the settings 
via fstab
entry? Look at man  tmpfs, man mount_msdosfs, for instance, they provide 
options which
can be put into the option column of fstab.

-- 
O. Hartmann

Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).


pgpE4XoPbQtrB.pgp
Description: OpenPGP digital signature


Re: mounting UFS2 filesystem with access mode via fstab

2018-01-21 Thread Gary Jennejohn
On Sun, 21 Jan 2018 11:37:16 +0100
"O. Hartmann"  wrote:

> Recently, I ran into the problem mounting a newly created /tmp, when I 
> switched back from
> a tmpfs-backed /tmp to a UFS2/SSD/HDD backed /tmp. 
> 
> The convenience to set mode=01777 for the memory/tmpfs backed /tmp seems not 
> to exist for
> UFS2 backed filesystems, since manpage mount(8) doesn't give me any option 
> provided via
> -o which could accomplish what I can achieve with mode=, see man tmpfs(5).
> 
> Well, I guess I do miss something here or is this achievement reached on a 
> different path
> I'm unaware of?
> 

chmod 1777 /tmp as root

-- 
Gary Jennejohn
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Periodical interrupt storm when playing game with USB keyboard

2018-01-21 Thread Johannes Lundberg
Hi

Finally I found the root to the problem that's been having me puzzled for
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 around
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:  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 about
input events.

I tried lowering the key repeat rate both with xset and kbdcontrol but it
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
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


mounting UFS2 filesystem with access mode via fstab

2018-01-21 Thread O. Hartmann
Recently, I ran into the problem mounting a newly created /tmp, when I switched 
back from
a tmpfs-backed /tmp to a UFS2/SSD/HDD backed /tmp. 

The convenience to set mode=01777 for the memory/tmpfs backed /tmp seems not to 
exist for
UFS2 backed filesystems, since manpage mount(8) doesn't give me any option 
provided via
-o which could accomplish what I can achieve with mode=, see man tmpfs(5).

Well, I guess I do miss something here or is this achievement reached on a 
different path
I'm unaware of?

Thanks in advance,

Oliver

-- 
O. Hartmann

Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).


pgpZjh9tBSlia.pgp
Description: OpenPGP digital signature