From owner-freebsd-stable@FreeBSD.ORG Wed Aug 8 13:36:06 2007 Return-Path: Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D523816A420 for ; Wed, 8 Aug 2007 13:36:06 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2001:1b20:1:3::1]) by mx1.freebsd.org (Postfix) with ESMTP id 47C0D13C46C for ; Wed, 8 Aug 2007 13:36:06 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (vqlwxk@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l78DZx3o045657 for ; Wed, 8 Aug 2007 15:36:04 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l78DZxN7045656; Wed, 8 Aug 2007 15:35:59 +0200 (CEST) (envelope-from olli) Date: Wed, 8 Aug 2007 15:35:59 +0200 (CEST) Message-Id: <200708081335.l78DZxN7045656@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 08 Aug 2007 15:36:04 +0200 (CEST) Cc: Subject: moused(8) consuming cpu for nothing X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2007 13:36:06 -0000 Hi, I noticed that the moused(8) process had accumulated about one minute of CPU time, after only three days of uptime. That's really a lot, given the fact that this server doesn't have a mouse connected at all. :-) Well, it is connected to a KVM switch, but it was never used since the last reboot. Accoding to "vmstat -i" psm0 received zero interrupts. So I really wonder why it has consumed that much CPU time. So I tried to strace the process, and got an endless series of these: 15:22:31.017275 gettimeofday({...}, NULL) = 0 15:22:31.017386 select(1024, [?], NULL, NULL, {...}) = 0 (Timeout) 15:22:31.038275 gettimeofday({...}, NULL) = 0 15:22:31.038386 select(1024, [?], NULL, NULL, {...}) = 0 (Timeout) 15:22:31.059276 gettimeofday({...}, NULL) = 0 15:22:31.059387 select(1024, [?], NULL, NULL, {...}) = 0 (Timeout) 15:22:31.080275 gettimeofday({...}, NULL) = 0 15:22:31.080387 select(1024, [?], NULL, NULL, {...}) = 0 (Timeout) 15:22:31.101276 gettimeofday({...}, NULL) = 0 15:22:31.101387 select(1024, [?], NULL, NULL, {...}) = 0 (Timeout) 15:22:31.122276 gettimeofday({...}, NULL) = 0 15:22:31.122388 select(1024, [?], NULL, NULL, {...}) = 0 (Timeout) 15:22:31.143275 gettimeofday({...}, NULL) = 0 15:22:31.143386 select(1024, [?], NULL, NULL, {...}) = 0 (Timeout) 15:22:31.164276 gettimeofday({...}, NULL) = 0 15:22:31.164388 select(1024, [?], NULL, NULL, {...}) = 0 (Timeout) 15:22:31.185276 gettimeofday({...}, NULL) = 0 15:22:31.185387 select(1024, [?], NULL, NULL, {...}) = 0 (Timeout) .. and so on. So it seems to call select(2) with a 0.02s timeout and then gettimeofday(2) within a loop. 50 times per second. Without doing anything useful (remember there's no mouse device connected and zero interrupts occuring). Is that normal, or is it a bug? For now I have killed and disabled moused(8) on all machines in the server farm, but it is somewhat inconvenient to have to start moused(8) manually each time a server is switched onto the KVM. Best regards Oliver PS: Just in case it matters (these are all the defaults): kern.clockrate: { hz = 1000, tick = 1000, profhz = 666, stathz = 133 } kern.timecounter.choice: TSC(-100) HPET(2000) ACPI-fast(1000) i8254(0) dummy(-1000000) kern.timecounter.hardware: HPET -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd It's trivial to make fun of Microsoft products, but it takes a real man to make them work, and a God to make them do anything useful.