[SOLVED] ODROID-C2 spawns 300+ virtual consoles

Post Reply
User avatar
graysky
Posts: 138
Joined: Wed Jul 13, 2016 9:11 am
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

[SOLVED] ODROID-C2 spawns 300+ virtual consoles

Unread post by graysky » Fri Dec 14, 2018 7:45 am

I found this old thread that exactly describes the situation on my ODROID-C2. Booting a fresh Arch ARM image (the linked thread shows it affects Debian also), causes systemd to spawn hundreds of ttys. I currently have 258 ttys running per systemd and 323 per a simple ls of /dev/tty*

Sample from systemctl:

Code: Select all

...
sys-devices-virtual-tty-ttya0.device                                       loaded active plugged   /sys/devices/virtual/tty/ttya0                         
sys-devices-virtual-tty-ttya1.device                                       loaded active plugged   /sys/devices/virtual/tty/ttya1                         
sys-devices-virtual-tty-ttya2.device                                       loaded active plugged   /sys/devices/virtual/tty/ttya2                         
...
sys-devices-virtual-tty-ttyzc.device                                       loaded active plugged   /sys/devices/virtual/tty/ttyzc                         
sys-devices-virtual-tty-ttyzd.device                                       loaded active plugged   /sys/devices/virtual/tty/ttyzd                         
sys-devices-virtual-tty-ttyze.device                                       loaded active plugged   /sys/devices/virtual/tty/ttyze                         
sys-devices-virtual-tty-ttyzf.device                                       loaded active plugged   /sys/devices/virtual/tty/ttyzf

Code: Select all

% ls -1 /dev/tty* | wc -l
323
From the linked thread:
gripped wrote:I think it is kernel related

https://raw.githubusercontent.com/hardk ... _defconfig

Code: Select all

CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
(it is also set in the u2 kernel)
This is also true on my ODROID-C2:

Code: Select all

% zgrep LEGACY_PTY /proc/config.gz      
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
It is NOT true on my RPi3 running armv7h:

Code: Select all

% zgrep LEGACY_PTY /proc/config.gz
# CONFIG_LEGACY_PTYS is not set
Note that I can append pty.legacy_count=2 to /boot/boot.ini to get a sane number:

Code: Select all

...
setenv bootargs "root=/dev/mmcblk0p1 rootwait rw ${condev} no_console_suspend hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam} ${hid_quirks} audit=0 pty.legacy_count=2"
1) Is this setting really needed for the ODROID-C2?
2) If not, can you upstream HK? consider changing it?
Last edited by graysky on Sun Dec 23, 2018 9:22 pm, edited 1 time in total.

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: ODROID-C2 spawns 300+ virtual consoles

Unread post by mad_ady » Fri Dec 14, 2018 2:55 pm

I wonder if it's using up resources (ram/cpu). It may just be creating those dev entries and if unused you should be fine.

User avatar
graysky
Posts: 138
Joined: Wed Jul 13, 2016 9:11 am
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: ODROID-C2 spawns 300+ virtual consoles

Unread post by graysky » Fri Dec 14, 2018 3:50 pm

mad_ady wrote:I wonder if it's using up resources (ram/cpu). It may just be creating those dev entries and if unused you should be fine.
It wastes 5 megs of RAM... the output of `free -m` for used is 96 with it and 101 without it.

User avatar
mad_ady
Posts: 6176
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 123 times
Been thanked: 87 times
Contact:

Re: ODROID-C2 spawns 300+ virtual consoles

Unread post by mad_ady » Fri Dec 14, 2018 4:09 pm

In this case the number of ptys should be reduced. In 20 years of linux usage I never used more than tty1-7 for local login.

User avatar
odroid
Site Admin
Posts: 31377
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 52 times
Been thanked: 184 times
Contact:

Re: ODROID-C2 spawns 300+ virtual consoles

Unread post by odroid » Tue Dec 18, 2018 11:01 am

We will try to reduce the number.

User avatar
graysky
Posts: 138
Joined: Wed Jul 13, 2016 9:11 am
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: ODROID-C2 spawns 300+ virtual consoles

Unread post by graysky » Sun Dec 23, 2018 9:22 pm

odroid wrote:
Tue Dec 18, 2018 11:01 am
We will try to reduce the number.
Just updated to the new kernel (with the config you modified) and now things are as expected. Thanks!

Code: Select all

% systemctl
...
UNIT                                                                       LOAD   ACTIVE SUB       DESCRIPTION                                                         
proc-sys-fs-binfmt_misc.automount                                          loaded active waiting   Arbitrary Executable File Formats File System Automount Point       
sys-devices-c11084c0.serial-tty-ttyS1.device                               loaded active plugged   /sys/devices/c11084c0.serial/tty/ttyS1                              
sys-devices-c81004c0.serial-tty-ttyS0.device                               loaded active plugged   /sys/devices/c81004c0.serial/tty/ttyS0                              
sys-devices-c9410000.ethernet-net-eth0.device                              loaded active plugged   /sys/devices/c9410000.ethernet/net/eth0                             
...

Code: Select all

% ls -1 /dev/tty* | wc -l
67

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 1 guest