svn commit: r208585 - head/sys/mips/mips

Neel Natu neelnatu at gmail.com
Thu May 27 06:24:51 UTC 2010


Hi Alexander,

On Wed, May 26, 2010 at 8:20 PM, Alexander Motin <mav at freebsd.org> wrote:
> Neel Natu wrote:
>> Author: neel
>> Date: Thu May 27 01:27:25 2010
>> New Revision: 208585
>> URL: http://svn.freebsd.org/changeset/base/208585
>>
>> Log:
>>   Simplify clock interrupt handling on mips by using the new KPI - timer1clock()
>>   and timer2clock().
>>
>>   Dynamically adjust the tick frequency depending on the value of 'hz'. Tested
>>   with hz values of 100, 1000 and 2000.
>>
>> Modified:
>>   head/sys/mips/mips/tick.c
>
>> -             if (profprocs != 0)
>> -                     profclock(TRAPF_USERMODE(tf), tf->pc);
>> -     }
>> +     timer1clock(TRAPF_USERMODE(tf), tf->pc);
>> +     timer2clock(TRAPF_USERMODE(tf), tf->pc);
>>       critical_exit();
>> -#if 0 /* TARGET_OCTEON */
>
> You are not setting timer2hz, so timer2clock() will be emulated
> automatically. It should not be called explicitly, or statclock() will
> be called twice.
>

I'll fix this.

> Also, as soon as you run timer1 on frequency higher then hz - it is
> strange to see
>        stathz = hz;
>        profhz = hz;
> there. It is just useless. Better would be to do same as for x86:
>        profhz = timer1hz;
>        if (timer1hz < 128)
>                stathz = timer1hz;
>        else
>                stathz = timer1hz / (timer1hz / 128);
>

I see your point with the profiling timer. I'll fix that to be like x86.

However it is not immediately obvious why we prefer to run the
statistics timer at (or very close to) 128Hz. Any pointers?

best
Neel

> --
> Alexander Motin
>


More information about the svn-src-all mailing list