From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 2 10:30:52 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 911C316A417; Sat, 2 Feb 2008 10:30:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id CDACC13C46A; Sat, 2 Feb 2008 10:30:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.7.0 Received: from [212.86.226.226] (account mav@alkar.net HELO [192.168.3.2]) by cmail.optima.ua (CommuniGate Pro SMTP 5.1.14) with ESMTPA id 72031923; Sat, 02 Feb 2008 12:30:51 +0200 Message-ID: <47A44652.70409@FreeBSD.org> Date: Sat, 02 Feb 2008 12:30:42 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Joseph Koshy References: <47A25412.3010301@FreeBSD.org> <47A25A0D.2080508@elischer.org> <47A2C2A2.5040109@FreeBSD.org> <20080201185435.X88034@fledge.watson.org> <47A37E14.7050801@FreeBSD.org> <84dead720802020209n49c09664p3962fa08f2f9a57c@mail.gmail.com> In-Reply-To: <84dead720802020209n49c09664p3962fa08f2f9a57c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-performance@freebsd.org Subject: Re: Memory allocation performance 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: Sat, 02 Feb 2008 10:30:52 -0000 Joseph Koshy wrote: > You cannot sample with the TSC since the TSC does not interrupt the CPU. > For CPU cycles you would probably want to use "p4-global-power-events"; > see pmc(3). Thanks, I have already found this. There was only problem, that by default it counts cycles only when both logical cores are active while one of my cores was halted. Sampling on this, profiler shown results close to usual profiling, but looking more random: 175.97 1.49 1/64 ip_input [49] 175.97 1.49 1/64 g_alloc_bio [81] 175.97 1.49 1/64 ng_package_data [18] 1055.81 8.93 6/64 em_handle_rxtx [4] 2639.53 22.32 15/64 em_get_buf [19] 3343.41 28.27 19/64 ng_getqblk [17] 3695.34 31.25 21/64 ip_forward [14] [9]21.6 11262.00 95.23 64 uma_zalloc_arg [9] 35.45 13.03 5/22 critical_exit [75] 26.86 0.00 22/77 critical_enter [99] 19.89 0.00 18/19 mb_ctor_mbuf [141] 31.87 0.24 4/1324 ng_ether_rcvdata [13] 31.87 0.24 4/1324 ip_forward [14] 95.60 0.73 12/1324 ng_iface_rcvdata [16] 103.57 0.79 13/1324 m_freem [25] 876.34 6.71 110/1324 mb_free_ext [30] 9408.75 72.01 1181/1324 ng_free_item [11] [10]20.2 10548.00 80.73 1324 uma_zfree_arg [10] 26.86 0.00 22/77 critical_enter [99] 15.00 11.59 7/7 mb_dtor_mbuf [134] 19.00 6.62 4/4 mb_dtor_pack [136] 1.66 0.00 1/32 m_tag_delete_chain [114] 21.4 11262.00 11262.00 64 175968.75 177456.76 uma_zalloc_arg [9] 20.1 21810.00 10548.00 1324 7966.77 8027.74 uma_zfree_arg [10] 5.6 24773.00 2963.00 1591 1862.35 2640.07 ng_snd_item [15] 3.5 26599.00 1826.00 33 55333.33 55333.33 ng_address_hook [20] 2.4 27834.00 1235.00 319 3871.47 3871.47 ng_acquire_read [28] To make statistics better I need to record sampling data with smaller period, but too much data creates additional overhead including disc operations and brakes statistics. Is there any way to make it more precise? What sampling parameters should I use for better results? -- Alexander Motin