Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 May 2010 06:20:03 +0300
From:      Alexander Motin <mav@FreeBSD.org>
To:        Neel Natu <neel@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r208585 - head/sys/mips/mips
Message-ID:  <4BFDE4E3.4060300@FreeBSD.org>
In-Reply-To: <201005270127.o4R1RPaT016558@svn.freebsd.org>
References:  <201005270127.o4R1RPaT016558@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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