GNU bug report logs - #39341
Installer using 100% of a CPU core

Previous Next

Package: guix;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Wed, 29 Jan 2020 05:20:01 UTC

Severity: important

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 39341 <at> debbugs.gnu.org, 39341-done <at> debbugs.gnu.org, "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: bug#39341: Installer using 100% of a CPU core
Date: Thu, 29 Apr 2021 11:59:05 +0200
Hello!

Mathieu Othacehe <othacehe <at> gnu.org> skribis:

> Your recent patch is just revealing an issue we always had with this
> Kmscon patch. Basically, without the "unlink" called you introduced, the
> FIFO fd was added only to the first discovered input and the keyboard
> layout was only applied to that very input.
>
> Conveniently, that input was always the main user keyboard I guess. The
> attached patch fixes that issue by registering the FIFO on the first
> input, but applying the keyboard layout to all the inputs.

Oh, fun (indeed I tested on a laptop with an external USB keyboard).

>>From 1a0fddd844ced62c802db0d6d133af45880435f0 Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <othacehe <at> gnu.org>
> Date: Thu, 29 Apr 2021 11:11:32 +0200
> Subject: [PATCH] gnu: kmscon: Fix layout setup.
>
> Kmscon may discover multiple inputs, corresponding to multiple devices. This
> means that the uxkb_dev_keymap_update function may be called multiple times,
> and the FIFO is registered on each input poll loop.
>
> When a new layout is written on the FIFO by the installer, the first input
> picking up the message, will apply the new layout. However, that input may not
> be the input that the user is currently using.
>
> To fix it, register the FIFO on the first input poll loop, but apply the new
> layout on all the inputs in the uxkb_keymap_update_handler function.
>
> * gnu/packages/patches/kmscon-runtime-keymap-switch.patch
> (uxkb_keymap_update_handler): Apply the new layout to all the inputs.
> (uxkb_dev_keymap_update): Register the FIFO fd only on the first input poll loop.

Tested in a VM: it switches layouts like crazy, doesn’t leak a single
FD, and generally behaves as expected.

Thumbs up!

Thanks,
Ludo’.




This bug report was last modified 4 years and 25 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.