From owner-freebsd-stable@FreeBSD.ORG Mon Jan 9 14:00:23 2012 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 E59961065672 for ; Mon, 9 Jan 2012 14:00:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 768468FC08 for ; Mon, 9 Jan 2012 14:00:20 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 80AF446B09; Mon, 9 Jan 2012 09:00:18 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F2F6CB991; Mon, 9 Jan 2012 09:00:17 -0500 (EST) From: John Baldwin To: freebsd-stable@freebsd.org Date: Mon, 9 Jan 2012 08:59:05 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201090859.05709.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Jan 2012 09:00:18 -0500 (EST) Cc: Phil Kulin Subject: Re: kproc_info system and user time is broken for processes with threads X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 14:00:24 -0000 On Saturday, January 07, 2012 5:06:46 pm Phil Kulin wrote: > kproc_info system and user time is broken for processes with threads, > when fetch then by kvm_getprocs() function call. > For example, modern 'ps' on server running mysqld (145 precached threads) > > # ps -ax -o comm,cputime,systime,usertime | grep mysqld > mysqld 16872:35.39 5249:07.68 3353:36.79 > # ps -ax -o comm,cputime,systime,usertime | grep httpd > httpd 0:00.02 0:00.00 0:00.02 > httpd 0:00.00 0:00.00 0:00.00 > httpd 0:02.51 0:01.77 0:00.75 > > Sum systime+usertime=cputime for httpd, but different for mysqld. > systime and usertime for mysqld not changed many times, but cputime increased. > Modern ps uses ki_rusage.ru_stime and ki_rusage.ru_utime from > kproc_info for systime and usertime statistic. > > What wrong? Hmm, I can't see anything that would explain this. What if you look at individual threads of mysqld (using 'H') flag? Also, which OS version are you using? -- John Baldwin