From owner-freebsd-mips@FreeBSD.ORG Tue Jul 27 09:24:11 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 65899106567E; Tue, 27 Jul 2010 09:24:11 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id BAD218FC23; Tue, 27 Jul 2010 09:24:10 +0000 (UTC) Received: by vws7 with SMTP id 7so4038150vws.13 for ; Tue, 27 Jul 2010 02:24:09 -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=T+wbIPQERPn7LzHvLknNSDzpU+ibs83d25iNpOiZEMw=; b=fLuAyBDOOxjuMlaB7PrwUx+IISobf/CQoK2nHnbVJn/VRfGzEf2S58AWB9MXtgfy3C eayiQT4aJM4QzUWbVOE3tISspuO84iRrfw/D1GsQqJmZkqqZ+JWzgPOTH9HDw7rYr8MC 6+tCycRd7QHKW+VP41KyCpCeHnH+aFHke/Zik= 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=m4k3lsb4AwsTBAcqsFQkD0mFEIMdxWy+kwvNibLlJ8gHBCqOa99eY9a9csPHnLYJg6 VvXgAC2JoWnRYScHZxRQZNuXbotcINlAXpcla5LBIoYSteb9SIbyUENYuT/AFa8496zo meOTbB5iR+/0DcWpf8pe8akybyOeuj8Z1Cd5E= MIME-Version: 1.0 Received: by 10.220.62.136 with SMTP id x8mr4912621vch.10.1280222649705; Tue, 27 Jul 2010 02:24:09 -0700 (PDT) Received: by 10.220.195.11 with HTTP; Tue, 27 Jul 2010 02:24:09 -0700 (PDT) In-Reply-To: <4C4205CC.6080700@FreeBSD.org> References: <4C41A248.8090605@FreeBSD.org> <4C41B4CF.6080409@FreeBSD.org> <4C4205CC.6080700@FreeBSD.org> Date: Tue, 27 Jul 2010 14:54:09 +0530 Message-ID: From: "Jayachandran C." To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Randall Stewart , Neel Natu , 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 09:24:11 -0000 On Sun, Jul 18, 2010 at 1:04 AM, Alexander Motin wrote: > Jayachandran C. wrote: >> On XLR we would like to use the count/compare which is faster but less >> accurate on all cpus - we can have upto 32 cpus now. =A0We also have a >> PIC which can provide a better timestamp and timer interrupts. =A0This >> PIC timestamp can be read from all CPUs but the timer interrupt can be >> delivered to just one CPU at a time. =A0I think this is how we ended up >> with the current implementation, but any suggestions on how to improve >> this is welcome. As a first step, I have copied the count /compare code from mips with minor modifications into mips/rmi, this lets me boot up (checked in as r210528). I would like to add the PIC based clock next. > I would prefer to not mix the things. > > I think: > =A0- PIC timestamp looks like the best candidate for system timecounter. > =A0- per-CPU counters could be registered as per-CPU timecounters with > set_cputicker() - the main criteria there is a speed. > =A0- if per-CPU counters are synchronized between CPUs - they could be > 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 which > one he likes more. > =A0- if there is any other timer hardware - it also should be registered = - > it will give additional flexibility. The per-cpu count/compare counters are not synchronized on XLR. 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 boot= up. --- 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 can be? Thanks, JC.