From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DNS_FROM_AHBL_RHSBL,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrfy.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=2AYdvxfPhzF1UD1XRaPrZvdqyXnLSpVpmuuJW6OOV7A=; b=dzTIxgYtYvR8bliki4MoAMPQKpgzi9OWbmlCjznENREeRtrrSgBGCGeRqshmi9XU0V Ib83FVqRDEs3MmqdfYqqzVDN7BkURTiUYe1jszDczilAYVj+I2IoTO6ecbocb5gn5sQq Ra4+fakQ5jtuzFXSHol2W8T8oI0DyYq7r1Kx4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=2AYdvxfPhzF1UD1XRaPrZvdqyXnLSpVpmuuJW6OOV7A=; b=UX2r71zQA1vj7tnxqy+fBZeYv4d0wWrToN5NtxnNzlq44F37rqZKhglKkeH3mOv1hc kPL0g4UIuUZ7EsELNLdb34WB8g7nzkoRPrkW5xdgI7+tNIWjKIKlALcXcSKr0Nec2AH+ KyjBaf9dq2yhScOeks6qhCu4f1SGaw18Hz3G+yH+zzf8ktASnMRn3WPV2S4OGjYG+cWt yrJC7FHT8Lad0b/MvZhyqonBaeK4upOQrS41NyCOpTXxgVfYRE34G0ELn4rTrN2BKRTj es1Xtv7J9gaIf2rb5joNArabpGBTk01mhmsyAVkill4zjC9KQqhl/PIwjj22UrE4fRHv rhRQ== X-Gm-Message-State: ALoCoQkAA15jObL94kb+L9hH/X5R7qjyanZkjA39LDIORswarhCnooYw6Pa4iYLtbhOL8KaMlQXW X-Received: by 10.43.13.71 with SMTP id pl7mr78204812icb.31.1427918170740; Wed, 01 Apr 2015 12:56:10 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20150123021329.GF2702@gardel-login> From: Kay Sievers Date: Wed, 1 Apr 2015 21:55:50 +0200 Message-ID: To: Andy Lutomirski Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Wed, 01 Apr 2015 23:56:24 +0300 Cc: systemd Mailing List , Lennart Poettering , kbd@lists.altlinux.org Subject: Re: [kbd] [systemd-devel] systemd-vconsole-setup fails very slowly X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 19:56:13 -0000 Archived-At: List-Archive: On Wed, Apr 1, 2015 at 9:36 PM, Andy Lutomirski wrote: > On Wed, Apr 1, 2015 at 12:32 PM, Kay Sievers wrote: >> On Wed, Apr 1, 2015 at 8:56 PM, Andy Lutomirski wrote: >>> On Thu, Jan 22, 2015 at 6:29 PM, Andy Lutomirski wrote: >>>> On Thu, Jan 22, 2015 at 6:13 PM, Lennart Poettering >>>> wrote: >>>>> On Wed, 21.01.15 19:15, Andy Lutomirski (luto@amacapital.net) wrote: >>>>> >>>>>> Hi all- >>>>>> >>>>>> When running virtme (a simple vm gadget) on Fedora 21, the slowest >>>>>> part of bootup by far appears to be systemd-vconsole-setup: >>>>>> >>>>>> # time /usr/lib/systemd/systemd-vconsole-setup >>>>>> putfont: PIO_FONT trying ... >>>>>> ................... >>>>>> setfont: putfont: 512,8x16: failed: -1 >>>>>> putfont: PIO_FONT: Invalid argument >>>>>> /usr/bin/setfont failed with error code 71. >>>>> >>>>> setfont is not part of systemd, we just invoke it. If that fails, this >>>>> is a problem somewhere between the VM, the kernel and console-tools. >>>>> >>>> >>>> Aha -- I missed that systemd-vconsole-setup calls setfont. I can >>>> trigger the same problem by just typing setfont. For whatever reason, >>>> my other Fedora 21 computer only has this problem if I type setfont >>>> and not if I run systemd-vconcole-setup. >>>> >>>>> My uneducated guess is that your virtual machine boots up with a >>>>> non-graphical console, and the tool thus tries to upload the fonts >>>>> into the good old VGA hw text mode glyph tables, and qemu is very slow >>>>> at that... Or something like that. >>>> >>>> setfont is doing this: >>>> >>>> nanosleep({0, 250000000}, NULL) = 0 >>>> ioctl(3, PIO_FONT, 0xfbc010) = -1 EINVAL (Invalid argument) >>>> write(2, ".", 1.) = 1 >>>> nanosleep({0, 250000000}, NULL) = 0 >>>> ioctl(3, PIO_FONT, 0xfbc010) = -1 EINVAL (Invalid argument) >>>> write(2, ".", 1.) = 1 >>>> nanosleep({0, 250000000}, NULL) = 0 >>>> ioctl(3, PIO_FONT, 0xfbc010) = -1 EINVAL (Invalid argument) >>>> write(2, ".", 1.) = 1 >>>> nanosleep({0, 250000000}, NULL) = 0 >>>> ioctl(3, PIO_FONT, 0xfbc010) = -1 EINVAL (Invalid argument) >>>> write(2, ".", 1.) = 1 >>>> nanosleep({0, 250000000}, NULL) = 0 >>>> ioctl(3, PIO_FONT, 0xfbc010) = -1 EINVAL (Invalid argument) >>>> write(2, ".", 1.) = 1 >>>> >>>> This thing has only a serial console: >>>> >>>> # cat /proc/consoles >>>> ttyS0 -W- (EC a) 4:64 >>>> >>>> setfont does this: >>>> >>>> /* we allow ourselves to hang here for ca 5 seconds, xdm may >>>> be playing tricks on us. */ >>>> while ((loop++ < 20) && (i = ioctl(fd, PIO_FONT, buf))) >>>> { >>>> if (loop <= 1) >>>> fprintf(stderr, "putfont: PIO_FONT trying ...\n"); >>>> else >>>> fprintf(stderr, "."); >>>> usleep(250000); >>>> } >>>> fprintf(stderr, "\n"); >>>> >>>> Alexey, would it make sense to remove this loop or to add a way to turn it off? >>> >>> Ping, everyone? >>> >>> This issue still exists. AFAICT systemd is relying on a really old >>> tool, that that really old tool (setfont) is sometimes delaying boot >>> by a very large amount. Can we either fix the tool (Alexey) or stop >>> using it (systemd people)? >> >> Hmm, why is the "vm gadget" you run configuring a custom console font >> at all? If there is no custom font specified in t he config, systemd >> will not run setfont. > > It's not intentionally configuring a custom font, but it might be > inheriting Fedora's settings. Ideally, /etc/vconsole.conf does not even exist in a default setup. It is only needed for foreign language keyboard support or more exotic font requirements. >> Or did you mean to have vconsole-setup detect that it should not even >> try to run setfont? Not sure how to find that out. >> >> I don't really see how vconsole-setup could get rid of calling setfont >> from systemd, it is needed in many setups. > > vconsole-setup could set the font itself instead of using setfont if > setfont can't be configured or fixed not to keep retrying for five > seconds (!). It is a rather complex logic which would need to be duplicated in systemd. We so far have avoided it, because the kernel VC font and keymaps are so conceptually limited, that it does not really make sense to build a modern system on top of it. If systemd gets advanvced console support with systemd-consoled, we need full unicode support, high-dpi display support, display hotplug, ..., all things the kernel's vc stuff will never give us. That is why we rely on setfont and loadkeys for now. > Ideally, I think that setfont would just stop retrying on failure. Right, that sounds like a simple and sensible fix. > Or > perhaps all of this could go through udev or some other mechanism that > doesn't try to set the font until the device actually exists. But the > console system is weird and may be that's hard. The devices should be always there, /dev/tty1-15. It looks like the driver behind the ttys seems not to accept the font and return EINVAL. Not sure if udev could make a difference here. Do you have an idea why the VM does not accept the custom font? If that is something obvious, and we can detect it, we could make vconsole-setup check for it. But then again, fixing setfont seems like the obvious fix here. Kay