From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752100AbcAENSM (ORCPT ); Tue, 5 Jan 2016 08:18:12 -0500 Received: from mail-io0-f172.google.com ([209.85.223.172]:35992 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751188AbcAENSH (ORCPT ); Tue, 5 Jan 2016 08:18:07 -0500 Subject: Re: [PATCH] Add possibility to set /dev/tty number To: One Thousand Gnomes References: <20160104154305.GA24533@kroah.com> <568AA47D.6010604@gmail.com> <20160104171121.GA25961@kroah.com> <568ABCBD.3070909@gmail.com> <20160104225544.158dc847@lxorguk.ukuu.org.uk> Cc: Greg KH , Pierre Paul MINGOT , jslaby@suse.cz, linux-kernel@vger.kernel.org From: "Austin S. Hemmelgarn" Message-ID: <568BC244.5040207@gmail.com> Date: Tue, 5 Jan 2016 08:16:52 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160104225544.158dc847@lxorguk.ukuu.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 160105-0, 2016-01-05), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-01-04 17:55, One Thousand Gnomes wrote: >>> If the console isn't initialized by userspace, is any of that space >>> still really being used? Have you tried that? >> I'm pretty certain that most of the space that gets taken up by the >> scrollback buffer and screen isn't directly used unless the console is >> used, but there are still structures that get allocated at driver >> instantiation for each VT, including the device structures and such. > > So fix that instead. I never said that it was broken, I was just pointing out that the overhead is non-zero even when the VT is unused. > > And really for low memory embedded why do you even have the VT layer in > your system in the first place ? Sometimes this is unavoidable. Any kind of generic system generally wants the VT layer, and there are a number of low memory embedded systems that I've seen that depend on the ability to switch VT's for their software to work correctly. > >>> If we remove the number of devices, those "broken" userspace programs >>> will also break, so that implies that we should not allow this change. >> No, the software should just need to be recompiled (I've tested this >> with ConsoleKit, which also fails gracefully when it tires to open a tty >> device that doesn't exist), or adapted to dynamically detect the number >> of TTYs (like it should have in the first place for portability reasons). > > We don't do regressions. Requiring only a recompilation isn't a regression, especially when it works fine without being recompiled, and I have yet to actually see anything that changing the number of VT's would break other than ConsoleKit (systemd-logind might also need a rebuild, but I'm not sure about that, and don't have a system I could test it on). > >> device drivers). I doubt that it will work out to any more than 16k size >> difference, but that's still a few more pages (on most systems) that >> could be used for other things. > > And those embedded devices can almost certainly save more by just not > including the vt layer. And a few pages can make a difference on _any_ device, not just an embedded system. For a purpose specific system, that can be the difference between fitting the working set in memory and having to hit swap space.