From owner-freebsd-current@FreeBSD.ORG Sat Sep 20 19:24:17 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E98EFEE5; Sat, 20 Sep 2014 19:24:17 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (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 61AE3F48; Sat, 20 Sep 2014 19:24:17 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XVQGQ-0001If-DY; Sat, 20 Sep 2014 19:24:10 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s8KJO9qr016862; Sat, 20 Sep 2014 13:24:09 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 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/hPFpEMvfkAv00kf34fk4v X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: FreeBSD-11.0-CURRENT on ARM: performance and load average From: Ian Lepore To: Maxim V FIlimonov In-Reply-To: <7351653.A2UeEk9AA3@quad> References: <7351653.A2UeEk9AA3@quad> Content-Type: multipart/mixed; boundary="=-z+3p5YfilYZLalC+jqRC" Date: Sat, 20 Sep 2014 13:24:08 -0600 Message-ID: <1411241048.66615.148.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: freebsd-arm@freebsd.org, freebsd-current@freebsd.org, mav@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2014 19:24:18 -0000 --=-z+3p5YfilYZLalC+jqRC Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Sat, 2014-09-20 at 22:44 +0400, Maxim V FIlimonov wrote: > Hello everyone, > > Recently, I encountered a problem with -CURRENT on an ARM board (cubieboard2 > to be precise). The problem was that the load average was above 2. Including > the fact that the board has 2 CPU cores, that's strange. Also, the network > throughput was way too slow: from 3 kilobytes per second earlier to 20..50 > about now. > > Here's a workaround for that: > > sysctl kern.eventtimer.periodic=1 > With that, the network performance increased while LA decreased to a decent > 0.3..0.5. Since it's happening only on that hardware, there's a good chance the problem is in the allwinner a10/a20 clock driver, not in the general eventtimer code. In fact, looking at the code it appears that a divide-by-16 is being set in the hardware, but not accounted for when setting the frequency of the eventtimer. Hmm, it should affect the timecounter too, in which case you'd see time-of-day advancing 16x too fast. If ntpd is running it would need to step the clock pretty frequently, which would show up in syslog. I don't have hardware to test on, please see if the attached patch makes a difference. -- Ian --=-z+3p5YfilYZLalC+jqRC Content-Disposition: inline; filename="allwinner_timer.diff" Content-Type: text/x-patch; name="allwinner_timer.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: sys/arm/allwinner/timer.c =================================================================== --- sys/arm/allwinner/timer.c (revision 271909) +++ sys/arm/allwinner/timer.c (working copy) @@ -199,7 +199,7 @@ a10_timer_attach(device_t dev) val |= TIMER_ENABLE; timer_write_4(sc, SW_TIMER_IRQ_EN_REG, val); - sc->timer0_freq = SYS_TIMER_CLKSRC; + sc->timer0_freq = SYS_TIMER_CLKSRC / 16; /* Set desired frequency in event timer and timecounter */ sc->et.et_frequency = sc->timer0_freq; --=-z+3p5YfilYZLalC+jqRC--