From owner-freebsd-mips@FreeBSD.ORG Tue Jul 27 15:06:35 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0E8E1065672; Tue, 27 Jul 2010 15:06:35 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D41608FC19; Tue, 27 Jul 2010 15:06:34 +0000 (UTC) Received: by fxm13 with SMTP id 13so689961fxm.13 for ; Tue, 27 Jul 2010 08:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=gOgY2bO44C2F9eDB5jtCu3Nu7G4Tj0uWd8CQCEs1vDU=; b=g9MYhuRveqWmJGslyUwnSy6mOFvWkPl70W075j8NF3mdqEh8w9h8eDx6S1c9vYRuuA UE69uICAzWuPAYkzymbOlRoE9DeSQxNi0jSoYJWABwiLmNVSvWM1/PMJTye54xFcnWWI BlNEoj7ei+lHHl6xtEwlxiRfIcnPKdALdRPIo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=jpgwMQF7DLpUqEonncuDai4byQAODQwMWuAUOg8+gT+K3Ff6JB7RVRmps/Dd5Mwcms RRg6wkHyigTxgonUy0HeupY+i87+sbL60raJRmJqO1QfIdixcYs/VJ/0ybjCVpJrqe5/ reLmZwYmmstXDyRlteLMR4bUExA+u95FLB5d0= MIME-Version: 1.0 Received: by 10.103.218.19 with SMTP id v19mr1163722muq.11.1280243193649; Tue, 27 Jul 2010 08:06:33 -0700 (PDT) Received: by 10.220.195.11 with HTTP; Tue, 27 Jul 2010 08:06:33 -0700 (PDT) In-Reply-To: <20100727.083543.653774248293717664.imp@bsdimp.com> References: <4C4205CC.6080700@FreeBSD.org> <20100727.083543.653774248293717664.imp@bsdimp.com> Date: Tue, 27 Jul 2010 20:36:33 +0530 Message-ID: From: "Jayachandran C." To: "M. Warner Losh" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: rrs@freebsd.org, mav@freebsd.org, neel@freebsd.org, freebsd-mips@freebsd.org Subject: Re: [RFC] Event timers on MIPS X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2010 15:06:36 -0000 On Tue, Jul 27, 2010 at 8:05 PM, M. Warner Losh wrote: > In message: > =A0 =A0 =A0 =A0 =A0 =A0"Jayachandran C." write= s: > : > I would prefer to not mix the things. > : > > : > I think: > : > =A0- PIC timestamp looks like the best candidate for system timecount= er. > : > =A0- per-CPU counters could be registered as per-CPU timecounters wit= h > : > set_cputicker() - the main criteria there is a speed. > : > =A0- if per-CPU counters are synchronized between CPUs - they could b= e > : > registered as alternative timecounter for people who wish fastest > : > timecounting; if they are not - they are useless in that role. > : > =A0- both PIC timer and per-CPU comparators should be independently > : > registered as eventtimers - it is better to have two of them to from > : > accounting correctness PoV, and it will allow user to experiment whic= h > : > one he likes more. > : > =A0- if there is any other timer hardware - it also should be registe= red - > : > it will give additional flexibility. > : > : The per-cpu count/compare counters are not synchronized on XLR. > > The Octeon processors have a register to force them to be > synchronized. =A0Once synchronized, except for some weird debug > scenarios, they stay synchronized. > > Does the XLR advanced the count counters at the same rate on all the > core at the same time? They are incremented at the same rate, but can set to different values on different cpus. The clocks are not hardware synchronized across cores, so they probably can drift over time, even though I'm not completely sure if this is significant. > : So your suggestion would be to add a PIC based clock which calls > : tc_init() and et_register(), and to leave the set_cputicker() to be > : the count/compare? > : > : Also, with just the count/compare, I get these print on early mutiuser = bootup. > : --- > : calcru: runtime went backwards from 85936878 usec to 236488 usec for > : pid 1286 (rpcbind) > : calcru: runtime went backwards from 7158742 usec to 19700 usec for pid > : 1285 (nfsiod 0) > : calcru: runtime went backwards from 111005442 usec to 305474 usec for > : pid 1257 (syslogd) > : calcru: runtime went backwards from 10740196 usec to 29555 usec for > : pid 1048 (devd) > : -- > : Did not get much time to investigate, any idea what the cause =A0can be= ? > > Is this multicore? yes - the changes suggested by mav@ seems to fixed it. JC.