From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QFDoE5d9imBnywAAgWs5BA (envelope-from ) for ; Thu, 29 Apr 2021 11:34:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WDmbD5d9imDlFwAAB5/wlQ (envelope-from ) for ; Thu, 29 Apr 2021 09:34:15 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7DF9621C98 for ; Thu, 29 Apr 2021 11:34:14 +0200 (CEST) Received: from localhost ([::1]:46586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lc33l-0003rn-0v for larch@yhetil.org; Thu, 29 Apr 2021 05:34:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lc33b-0003qQ-GC for bug-guix@gnu.org; Thu, 29 Apr 2021 05:34:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lc33b-0004PU-96 for bug-guix@gnu.org; Thu, 29 Apr 2021 05:34:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lc33b-0006i9-5t for bug-guix@gnu.org; Thu, 29 Apr 2021 05:34:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#39341: Installer using 100% of a CPU core Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 29 Apr 2021 09:34:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39341 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 39341-done@debbugs.gnu.org id=D39341.161968881025712 (code D ref 39341); Thu, 29 Apr 2021 09:34:03 +0000 Received: (at 39341-done) by debbugs.gnu.org; 29 Apr 2021 09:33:30 +0000 Received: from localhost ([127.0.0.1]:54839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lc334-0006ga-46 for submit@debbugs.gnu.org; Thu, 29 Apr 2021 05:33:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lc331-0006gA-AS; Thu, 29 Apr 2021 05:33:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39037) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lc32v-0003x6-0e; Thu, 29 Apr 2021 05:33:21 -0400 Received: from [2a01:e0a:19b:d9a0:9576:8bbf:4795:82ee] (port=37274 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lc32t-0005h1-BO; Thu, 29 Apr 2021 05:33:20 -0400 From: Mathieu Othacehe References: <87a766u9et.fsf@gmail.com> <87h7juf3dk.fsf@gnu.org> <20210426143225.fljn47jmgj5hhmra@pelzflorian.localdomain> <87fszdav22.fsf@gnu.org> <20210426161459.rfgxir2n5ya73vmv@pelzflorian.localdomain> <878s546mhs.fsf@gnu.org> <20210427123209.jyqw77edsbt5qhdj@pelzflorian.localdomain> <8735vbwh9q.fsf@gnu.org> <20210428070210.g3lntjoek5y6hyi7@pelzflorian.localdomain> <87sg3asexh.fsf@gnu.org> Date: Thu, 29 Apr 2021 11:33:17 +0200 In-Reply-To: <87sg3asexh.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Wed, 28 Apr 2021 15:43:06 +0200") Message-ID: <8735v91llu.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 39341@debbugs.gnu.org, 39341-done@debbugs.gnu.org, Maxim Cournoyer Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619688854; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=K/TWmAVz1Ao4tuwYI4WTPat49k7JuVD67HzvS/OtL18=; b=RnfbFOLsNVqSzbiw8Fqt5D2iMyUAhngpfwTWJfUYwE+lXDPlScVUbsrPrhFfX/vLEQ7Cot OaUHO/gZlDqFKIYNZabpinB3CeRPjncOwpQvz9WF3MaMc4uORP9BJxEJHUUKAmvpiyeQe4 BK+vdMG7EYJmFzZQUD44BeTzd3VO/fpbkW7jBC0aIef8nfz3axDwjaZkoBZZq1XTefoXeD K9mi5hFh0LMJmgVUp/W9RIfj39eg28SoDJ9iRtlGNr84dw1bHHQkhA5q8Z7fQIoSWqTC0y opzvEKtQmM0H880krjUM/Tv955JS4UJDd7PPplRJ6WiVBSPXWWbQ6c3J8jAvdg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619688854; a=rsa-sha256; cv=none; b=gSPSDGoyV215zBCx3cj67ae+Z2f3fpUR2eUmP2idaup6gv9n8Eb4XNZTCdY9n/guNxL/12 hrynFgNTUGrTK4yEwsfUdv9SbHjzaUb2OfcNQSIl+JbSxf+LwZ4VChXPAtUH6kUk1jq3c/ wKHbmvzqgpLai26aG1MMNHZ6ZL//rub4e+mGGS45QJdbJ+biiebIU0OQG8rry0Mr7k9SJ8 UwzmeVNehNIwWYFFrgdKlyry4rptQNLGgcZWfSDUg4EKkQphr+ZHL7EUF7hEbKD6sHjSMV qluzfvxYHa1mu8DWsij6vQWrDD4j81TLBYNPylCuNQyffJGGBO/uIiV+/KfhYw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.95 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 7DF9621C98 X-Spam-Score: -2.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4ohN93wr5KqK --=-=-= Content-Type: text/plain Hey Ludo, 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. Thanks, Mathieu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-kmscon-Fix-layout-setup.patch >From 1a0fddd844ced62c802db0d6d133af45880435f0 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe 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. --- .../kmscon-runtime-keymap-switch.patch | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/gnu/packages/patches/kmscon-runtime-keymap-switch.patch b/gnu/packages/patches/kmscon-runtime-keymap-switch.patch index 480aaecad2..abff9c460d 100644 --- a/gnu/packages/patches/kmscon-runtime-keymap-switch.patch +++ b/gnu/packages/patches/kmscon-runtime-keymap-switch.patch @@ -132,7 +132,7 @@ index 925c755..8fe08f8 100644 #include #include "shl_hook.h" #include "shl_llog.h" -@@ -178,6 +181,95 @@ static void timer_event(struct ev_timer *timer, uint64_t num, void *data) +@@ -178,6 +181,110 @@ static void timer_event(struct ev_timer *timer, uint64_t num, void *data) shl_hook_call(dev->input->hook, dev->input, &dev->repeat_event); } @@ -171,7 +171,23 @@ index 925c755..8fe08f8 100644 + + llog_info(dev->input, "HANDLER CALLED %s|%s|%s\n", + model, layout, variant); -+ uxkb_desc_init(dev->input, model, layout, variant, options, NULL); ++ ++ struct uterm_input *input = dev->input; ++ struct shl_dlist *iter; ++ ++ /* Apply the new layout to all the inputs. */ ++ shl_dlist_for_each(iter, &input->devices) { ++ struct uterm_input_dev *dev; ++ dev = shl_dlist_entry(iter, ++ struct uterm_input_dev, ++ list); ++ uxkb_desc_init(dev->input, model, layout, variant, options, NULL); ++ dev->state = xkb_state_new(dev->input->keymap); ++ if (!dev->state) { ++ llog_error(dev->input, "cannot create XKB state"); ++ return; ++ } ++ } + + /* The client will now close the FIFO. Close it too, and re-create a + * FIFO so other clients can eventually connect. */ @@ -180,11 +196,6 @@ index 925c755..8fe08f8 100644 + dev->rupdate_fd = -1; + uxkb_dev_keymap_update(dev); + -+ dev->state = xkb_state_new(dev->input->keymap); -+ if (!dev->state) { -+ llog_error(dev->input, "cannot create XKB state"); -+ return; -+ } +} + +int uxkb_dev_keymap_update(struct uterm_input_dev *dev) @@ -193,6 +204,10 @@ index 925c755..8fe08f8 100644 + char *file; + int pid = getpid(); + ++ /* Add the FIFO fd only to the first input poll loop. */ ++ if (dev->rupdate_fd > 0) ++ return 0; ++ + ret = asprintf(&file, INPUT_KEYMAP_UPDATE_FILE, pid); + if (ret < 0) + return ret; -- 2.31.1 --=-=-=--