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

Alexander Motin mav at FreeBSD.org
Thu May 27 03:20:24 UTC 2010


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.

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);

-- 
Alexander Motin


More information about the svn-src-all mailing list