Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Mar 2010 11:28:40 -0800
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        John Baldwin <john@baldwin.cx>
Cc:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   Re: svn commit: r205025 - user/jmallett/octeon/sys/mips/mips
Message-ID:  <eaa228be1003121128w7d38b66cq3c661db7f76f0fa5@mail.gmail.com>
In-Reply-To: <201003121203.44340.john@baldwin.cx>
References:  <201003112032.o2BKWTrG089154@svn.freebsd.org> <201003121203.44340.john@baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 12, 2010 at 09:03, John Baldwin <john@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:
>> =A0 I don't know that a critical section is required here, but if it is =
we
>> =A0really don't want to get interrupted between reading the counter and
>> =A0calculating the ticks.
>
> In practice I think cputicks are only queried while holding a spin lock (=
so
> interrupts are disabled). =A0Part of the comment before this is wrong as =
the
> cputicks are completely divorced from the timecounter code, so the tc cod=
e
> handling wrapping doesn't help any. =A0However, 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.



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