From owner-freebsd-current@FreeBSD.ORG Mon Nov 29 20:54:13 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A774716A4CE for ; Mon, 29 Nov 2004 20:54:13 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A0A143D2F for ; Mon, 29 Nov 2004 20:54:13 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.1) id iATKs8Fv090867; Mon, 29 Nov 2004 14:54:08 -0600 (CST) (envelope-from dan) Date: Mon, 29 Nov 2004 14:54:08 -0600 From: Dan Nelson To: Julian Elischer Message-ID: <20041129205408.GH5518@dan.emsphone.com> References: <20041128233704.GB62951@NitroPhys.welchsmnet.net> <20041129154805.GD5518@dan.emsphone.com> <41AB8174.4090205@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41AB8174.4090205@elischer.org> X-OS: FreeBSD 5.3-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-current@freebsd.org cc: Sean Welch Subject: Re: top under 5.3-RELEASE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Mon, 29 Nov 2004 20:54:13 -0000 In the last episode (Nov 29), Julian Elischer said: > Dan Nelson wrote: > >The values should total up better when you have processes that hang > >around a bit more. There was a regression in 5.3's libpthreads that > >can make it report 0 CPU, so if you have some CPU-hungry threaded > >programs, they may not show up in top at all even though they're > >using 100% cpu. libthr and libc_r report CPU correctly. > > As background, libpthread assigns user threads to arbitrary kernel > threads "as needed". The trouble is that if a user thread comes into > the kernel, uses a kernel thread, and then exits the kernel and > another user thread does the same, where can we store the info about > the first thread? We have no place to store this info in > libpthreads.. at least not in a form useful to 'top' and 'ps'. Can you just add the stats to the primary kse (the one with id==pid)? That's always around as long as the process exists afaik. Any thread would do, since you can't guarantee that a thread will use the same kse twice anyway. What's annoying is seeing a CPU-bound threaded app (mysql or java, for example) showing 0 %CPU in top/ps but the TIME column incrementing 1 per second... -- Dan Nelson dnelson@allantgroup.com