From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 12 04:11:39 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8826A16A417 for ; Tue, 12 Dec 2006 04:11:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA41F43CB9 for ; Tue, 12 Dec 2006 04:10:16 +0000 (GMT) (envelope-from adrian.chadd@gmail.com) Received: by wr-out-0506.google.com with SMTP id i28so838623wra for ; Mon, 11 Dec 2006 20:11:36 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=NcnI2P5EGJOCipY3SyRLYSDreWaVIpDneAyY6d7Osd8yqNm7e5+oBMehqvGzkBO1XEPDs9ITatDchyKQquwuSrERqYPXU2VL5RvjQ3EQbLTiGZY263XR1Axi9iJh2Cgg6R4/bDC+P0Z7gpS8/U7VJCocdkQa3CCNXI5aQsQRBI8= Received: by 10.90.94.2 with SMTP id r2mr7855475agb.1165896696087; Mon, 11 Dec 2006 20:11:36 -0800 (PST) Received: by 10.90.31.12 with HTTP; Mon, 11 Dec 2006 20:11:36 -0800 (PST) Message-ID: Date: Tue, 12 Dec 2006 13:11:36 +0900 From: "Adrian Chadd" Sender: adrian.chadd@gmail.com To: "Joseph Koshy" In-Reply-To: <84dead720612112006r5573a04fge2664ffe3a93f796@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <84dead720612112006r5573a04fge2664ffe3a93f796@mail.gmail.com> X-Google-Sender-Auth: 957ed23d4d227879 Cc: freebsd-hackers@freebsd.org Subject: Re: pmcstat and squid X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2006 04:11:39 -0000 On 12/12/06, Joseph Koshy wrote: > > I can think of one of two scenarios: > > 1) the squid process was in the kernel when the > samples got taken. This could happen if the > process was say in select() handling all the time. > 2) There a bug in my process handling code that is > being triggered (hwpmc undercounts process-mode > samples), and samples are being missed. I can't imagine why Squid would suddenly be in kernel mode all the time. In fact, its in kernel space about 20% of the time under this workload (with another 30% spent in interrupts.) Here's the output from my latest attempt: jacinta# pmcstat -S instructions -O samples.out ^Cjacinta# ls -l total 89650 -rw-r--r-- 1 root wheel 576 Dec 12 03:52 1 -rw-r--r-- 1 root wheel 91719744 Dec 12 04:10 samples.out jacinta# pmcstat -R samples.out -g jacinta# cd k7-retired-instructions/ jacinta# ls kernel.gmon ld-elf.so.1.gmon libc.so.6.gmon jacinta# ls -l total 3116 -rw-r--r-- 1 root wheel 2704268 Dec 12 04:10 kernel.gmon -rw-r--r-- 1 root wheel 59474 Dec 12 04:10 ld-elf.so.1.gmon -rw-r--r-- 1 root wheel 372962 Dec 12 04:10 libc.so.6.gmon Squid is running but there's no profiling information for it still.. Scarily, on this Athlon 1800XP: % cumulative self self total time seconds seconds calls ms/call ms/call name 5.1 45254.00 45254.00 SHA256_Transform [1] 4.0 81184.00 35930.00 tcp_input [2] 3.8 114879.00 33695.00 tcp_output [3] 2.8 139645.00 24766.00 critical_exit [4] 2.5 162199.00 22554.00 bus_dmamap_load_mbuf_sg [5] 2.3 182415.00 20216.00 generic_bzero [6] 2.1 201156.00 18741.00 kqueue_register [7] The kernel spends quite a bit of time in SHA256_Transform; I wonder if it has to do with the sheer volume of TCP connections I'm making..