From owner-svn-src-all@FreeBSD.ORG Thu May 27 03:20:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FA901065678; Thu, 27 May 2010 03:20:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 16D3B8FC13; Thu, 27 May 2010 03:20:22 +0000 (UTC) Received: by fxm20 with SMTP id 20so63619fxm.13 for ; Wed, 26 May 2010 20:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=v1e8Oz9vtO7vgqxSA0KfdQ6F5Wh7ZRHc/gSEW1HNgaA=; b=f00A1JeTflATK050KbpPl65JJPSQeqy/gyGo+t58VihiZ8q4LvE1i25LimpDp3i6Qo Y7wT1YE1l5sASA0Gb0Cvje663dDIB6DhD1xRpwZUIFA0j/20M8nnJyCP/Wlt4zu6ArOp 8oZ+ZsM2KZoBrzvq9jw2MJbrnt1qW2d8VVkYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=lXfeJwfr+t9/tVyZkTSc/rrZGPvIwSzAyLFY9Mh6UO81L1BwMZ+Q3U4/SdUX6xe9cK HTrYTU4DpyW09opdvOlfZimXMDr/5Rn58ZrQpKc1jiIomHDrdEbDzsI74zLK+AaavoKQ RGDADXD/DPysgXzTzMrMryUh7EehtITFiCneU= Received: by 10.223.45.200 with SMTP id g8mr3374948faf.67.1274930422183; Wed, 26 May 2010 20:20:22 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id u12sm3513892fah.4.2010.05.26.20.20.20 (version=SSLv3 cipher=RC4-MD5); Wed, 26 May 2010 20:20:21 -0700 (PDT) Sender: Alexander Motin Message-ID: <4BFDE4E3.4060300@FreeBSD.org> Date: Thu, 27 May 2010 06:20:03 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Neel Natu References: <201005270127.o4R1RPaT016558@svn.freebsd.org> In-Reply-To: <201005270127.o4R1RPaT016558@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r208585 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 03:20:24 -0000 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