From owner-freebsd-embedded@FreeBSD.ORG Thu Jun 19 15:59:06 2014 Return-Path: Delivered-To: freebsd-embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AE6F363; Thu, 19 Jun 2014 15:59:06 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 144FC2E9F; Thu, 19 Jun 2014 15:59:02 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Wxejm-000NP0-QI; Thu, 19 Jun 2014 15:58:54 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s5JFwqjx001259; Thu, 19 Jun 2014 09:58:52 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+DgdKx4U94WaNu8MaykbGV Subject: Re: Strange slowdown of zlib. From: Ian Lepore To: Magnus Nilsson In-Reply-To: References: Content-Type: text/plain; charset="us-ascii" Date: Thu, 19 Jun 2014 09:58:51 -0600 Message-ID: <1403193531.20883.269.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-arm , freebsd-embedded@FreeBSD.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jun 2014 15:59:06 -0000 On Thu, 2014-06-19 at 17:44 +0200, Magnus Nilsson wrote: > I have the strangest behaviour of zlib on FreeBSD 8.2 (ARM, but I don't > think it's necessarily an ARM specific issue). > Doing > # md5 /lib/libz.so.5 > or > # cp /lib/libz.so.5 /tmp/ > # export LD_LIBRARY_PATH=/tmp/ > slows down applications (I've tested bsdtar and gzip) using zlib to a crawl > on my system. > > In the later case, doing > # unset LD_LIBRARY_PATH > reverts the issue. > However, I haven't found any way to recover from the first case, apart from > rebooting - then the execution time is back to normal. > > Here is a log of what I describe above (first moving zlib, then doing the > md5): > # cp some2MBfile /tmp/ > # time gzip /tmp/some2MBfile > real 0m0.325s > user 0m0.284s > sys 0m0.037s > # rm /tmp/some2MBfile.gz > # cp /lib/libz.so.5 /tmp/ > # export LD_LIBRARY_PATH=/tmp/ > # cp some2MBfile /tmp/ > # time gzip /tmp/some2MBfile > real 0m11.949s > user 0m11.635s > sys 0m0.035s > # rm /tmp/some2MBfile.gz > # unset LD_LIBRARY_PATH > # cp some2MBfile /tmp/ > # time gzip /tmp/some2MBfile > real 0m0.325s > user 0m0.288s > sys 0m0.035s > # rm /tmp/some2MBfile.gz > # md5 /lib/libz.so.5 > # cp some2MBfile /tmp/ > # time gzip /tmp/some2MBfile > real 0m11.919s > user 0m11.608s > sys 0m0.031s > # rm /tmp/some2MBfile.gz > > Do you have any idea what could be going on? > Any clues are welcome. > > Kind regards/Magnus This is a known problem on armv4/v5 in freebsd 8. Here is some archived info on it including patches that work around the problem (rather crudely, but good enough for our needs at $work). http://lists.freebsd.org/pipermail/freebsd-arm/2012-January/003288.html -- Ian