Why is tc_get_timecount() called two times in tc_init()?

Mark Millard marklmi at yahoo.com
Thu Oct 3 08:23:18 UTC 2019


Konstantin Belousov kostikbel at gmail.com wrote on
Wed Oct 2 16:39:57 UTC 2019 :

> On Thu, Oct 03, 2019 at 02:25:46AM +1000, Bruce Evans wrote:
> > On Wed, 2 Oct 2019, Konstantin Belousov wrote:
> > 
> > > . . .
> > >
> > > I think that the addition of the second tc_get_timecount() was done
> > > earlier, in r95530, and there it has semi-useful comment
> > > +  /* Warm up new timecounter. */
> > > +  (void)newtc->tc_get_timecount(newtc);
> > > +  (void)newtc->tc_get_timecount(newtc);
> . . .
> > I think it never helped much.  For the TSC, the 2 calls are ordered only
> > relatively each other on a single CPU.  They are not ordered relative to
> > memory.  For the i8254, 1 call is enough.  The ACPI timer does hardware
> > accesses so it is in between.
> So the conclusion is that the second call can be removed, am I right ?

A fair amount of the material written seemed amd64/i384
specific history and I expect that this is machine
independent code. So I'll explicitly ask:

Can all the FreeBSD architectures currently get by without
the dual (void)newtc->tc_get_timecount(newtc) ?

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-hackers mailing list