Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jul 2010 20:36:33 +0530
From:      "Jayachandran C." <c.jayachandran@gmail.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        rrs@freebsd.org, mav@freebsd.org, neel@freebsd.org, freebsd-mips@freebsd.org
Subject:   Re: [RFC] Event timers on MIPS
Message-ID:  <AANLkTimxSZAx9YjLmiRG2fR9SKMVi46nqdmVkznXnxTU@mail.gmail.com>
In-Reply-To: <20100727.083543.653774248293717664.imp@bsdimp.com>
References:  <AANLkTik8_NGm7nKYXT1d1E4Vj6vYQPWHnnLDi78YnvQD@mail.gmail.com> <4C4205CC.6080700@FreeBSD.org> <AANLkTikUpqLeogkqxqWzzejp=7FstHX2wVRWNrYoWGCp@mail.gmail.com> <20100727.083543.653774248293717664.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jul 27, 2010 at 8:05 PM, M. Warner Losh <imp@bsdimp.com> wrote:
> In message: <AANLkTikUpqLeogkqxqWzzejp=3D7FstHX2wVRWNrYoWGCp@mail.gmail.c=
om>
> =A0 =A0 =A0 =A0 =A0 =A0"Jayachandran C." <c.jayachandran@gmail.com> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimxSZAx9YjLmiRG2fR9SKMVi46nqdmVkznXnxTU>