svn commit: r205025 - user/jmallett/octeon/sys/mips/mips

Juli Mallett jmallett at FreeBSD.org
Fri Mar 12 19:29:02 UTC 2010


On Fri, Mar 12, 2010 at 09:03, John Baldwin <john at baldwin.cx> wrote:
> On Thursday 11 March 2010 03:32:29 pm Juli Mallett wrote:
>> Author: jmallett
>> Date: Thu Mar 11 20:32:28 2010
>> New Revision: 205025
>> URL: http://svn.freebsd.org/changeset/base/205025
>>
>> Log:
>>   I don't know that a critical section is required here, but if it is we
>>  really don't want to get interrupted between reading the counter and
>>  calculating the ticks.
>
> In practice I think cputicks are only queried while holding a spin lock (so
> interrupts are disabled).  Part of the comment before this is wrong as the
> cputicks are completely divorced from the timecounter code, so the tc code
> handling wrapping doesn't help any.  However, if there is a way to use a
> single instruction to read all 64-bits of the ticker on mips64, it would
> probably be best to add a mips64-specific ticker method and use that for
> set_cputicker() instead of this one.

Alas, that comment is the only reference I can find to a 64-bit count
register on any MIPS platform when I set out looking as I implemented
exactly that.  I suspected the critical sections were gratuitous, but
wanted to at least make the code do look less wrong, even if it is
still wrong.  Thanks for clarifying that we're always in a spinlock
there.

Juli.


More information about the svn-src-user mailing list