[RFC] Event timers on MIPS

Jayachandran C. c.jayachandran at gmail.com
Tue Jul 27 15:40:42 UTC 2010


On Tue, Jul 27, 2010 at 8:46 PM, Alexander Motin <mav at freebsd.org> wrote:
> Alexander Motin wrote:
>> Jayachandran C. wrote:
>>> On Tue, Jul 27, 2010 at 6:04 PM, Alexander Motin <mav at freebsd.org> wrote:
>>>> Jayachandran C. wrote:
>>>>> 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  can be?
>>>> I think it can easily be result of broken tick_ticker().
>>> I'm planning to check-in the attached patch for mips/rmi, I think
>>> mips/mips would need something similar.
>>
>> Looks fine. Does it help?
>
> Sorry, after looked again, I've got one question. Why this:
>
> +       DPCPU_SET(counter_upper, t_upper);
> +       DPCPU_SET(counter_lower_last, t_lower_last);
>
> was moved out of the critical section? Due to the per-CPU nature of this
> function it probably always called inside critical section, so there is
> no problem I think. But IMHO either critical section calls there are
> unneeded, or above sets and mips_rd_count() worth moving inside of it.

I missed the critical section, I will move the DPCPU_SET and into the
critical section, since it is an obvious mistake I introduced.

There is a critical_enter/exit in cpu_intr too, with mips_rd_count() outside..

Thanks,
JC.


More information about the freebsd-mips mailing list