From owner-freebsd-mips@freebsd.org Sat Oct 31 08:56:34 2015 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 079FCA21769 for ; Sat, 31 Oct 2015 08:56:34 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 77F651BF3 for ; Sat, 31 Oct 2015 08:56:33 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221]) by hz.grosbein.net (8.14.9/8.14.9) with ESMTP id t9V8uSTY049786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 31 Oct 2015 09:56:29 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTP id t9V8uP3e047549 for ; Sat, 31 Oct 2015 15:56:25 +0700 (KRAT) (envelope-from eugen@grosbein.net) Subject: Re: CPU underload To: freebsd-mips@freebsd.org References: <56348063.3090508@grosbein.net> From: Eugene Grosbein Message-ID: <56348239.3050701@grosbein.net> Date: Sat, 31 Oct 2015 15:56:25 +0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <56348063.3090508@grosbein.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, T_DATE_IN_FUTURE_96_Q autolearn=no version=3.3.2 X-Spam-Report: * 0.0 T_DATE_IN_FUTURE_96_Q Date: is 4 days to 4 months after Received: * date * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hz.grosbein.net X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2015 08:56:34 -0000 On 31.10.2015 15:48, Eugene Grosbein wrote: > Hi! > > I'm trying to get familiar with PMC and uncover reason of MIPS32 > CPU being underloaded - about 50% - while performing traffic forwarding. > > It seems, kernel code abuses DELAY function as "pmcstat -S instructions -T" shows: [skip] > And why so heavy usage of _libmd_SHA256_Transf ? Well, it seems to be kern.random.harvest is guity for SHA256 abuse. I've set sysctl kern.random.harvest.mask=0 and now it' gone: PMC: [INSTR_EXECUTED] Samples: 7490 (100.0%) , 0 unresolved %SAMP IMAGE FUNCTION CALLERS 4.6 kernel ip_fastforward 4.5 kernel memcpy 4.4 kernel DELAY 3.9 kernel arge_start_locked 3.8 kernel _bus_dmamap_load_buf 3.2 kernel ether_nh_input 3.1 kernel if_inc_counter 3.0 kernel arge_intr 3.0 kernel ether_output 2.9 kernel _bus_dmamap_sync 2.6 kernel bzero 2.6 kernel critical_enter 2.4 kernel critical_exit 2.3 kernel bus_dmamap_sync_buf 2.2 kernel _rw_runlock_cookie 2.1 kernel rn_match 1.9 kernel __rw_rlock 1.7 kernel netisr_dispatch_src 1.5 kernel spinlock_exit 1.5 kernel uma_zalloc_arg 1.5 kernel generic_bs_barrier 1.4 kernel _bus_dmamap_load_mbu 1.4 kernel arge_newbuf 1.4 kernel _rm_rlock 1.4 kernel m_adj 1.4 libpmc.so. pmclog_read 1.4 kernel mipsNN_pdcache_wb_ra 1.4 kernel arpresolve 1.3 kernel bcmp 1.3 kernel ether_demux 1.3 kernel mipsNN_pdcache_inv_r 1.3 kernel _bus_dmamap_unload 1.2 kernel uma_zfree_arg 1.2 kernel if_transmit 1.2 kernel bus_dmamap_load_mbuf 1.1 kernel _rm_runlock 1.0 kernel rtfree CONVERSION STATISTICS:oc1_fib #exec/elf 1 #samples/total 102761 #samples/unknown-function 2939 #callchain/dubious-frames 23 Still too many of DELAYs.