From owner-freebsd-current@freebsd.org Wed Apr 7 13:08:45 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE5E25D6C81 for ; Wed, 7 Apr 2021 13:08:45 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FFl8F5LLqz3J70 for ; Wed, 7 Apr 2021 13:08:45 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: by mailman.nyi.freebsd.org (Postfix) id B51BB5D6B89; Wed, 7 Apr 2021 13:08:45 +0000 (UTC) Delivered-To: current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4E5E5D6847 for ; Wed, 7 Apr 2021 13:08:45 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFl8F3zF1z3JGC for ; Wed, 7 Apr 2021 13:08:45 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1lU7vA-000FMb-NO; Wed, 07 Apr 2021 16:08:36 +0300 Date: Wed, 7 Apr 2021 16:08:36 +0300 From: Slawa Olhovchenkov To: Poul-Henning Kamp Cc: current@freebsd.org Subject: Re: console getty uses 1.5% of CPU Message-ID: <20210407130836.GA80160@zxy.spb.ru> References: <69119.1617772960@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69119.1617772960@critter.freebsd.dk> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 4FFl8F3zF1z3JGC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2021 13:08:45 -0000 On Wed, Apr 07, 2021 at 05:22:40AM +0000, Poul-Henning Kamp wrote: > I have two 12.2-R systems where the serial console is attached to a terminal server. > > When there are no TCP connections to the terminal server, getty soaks up 1.5% of the > CPU in the kernel (sleeping in "ttyin"), ktrace shows no system calls. > > When a TCP connection is made to the terminal server, which raises the modem-handshake > on the DE-9 connector, the CPU usage stops. > > Anybody else seeing something like this ? Problem of comparing low number? Top's "getty 1.5% of the CPU" is not "getty eat 1.5% of the ALL CPU power", this is "getty 1.5% of off all other curerent eats of CPU power". T.e. if all system eat 985 ticks of CPU each second and getty eat 15 ticks of CPU each second -- top show 1.5% for getty. Load is raised to 99_985 ticks for system, getty eat 15 ticks -- top show 0% ( 15/(99985+15) = .015% ).