From owner-svn-src-all@FreeBSD.ORG Thu May 27 06:24:51 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 A4619106567A; Thu, 27 May 2010 06:24:51 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-pz0-f183.google.com (mail-pz0-f183.google.com [209.85.222.183]) by mx1.freebsd.org (Postfix) with ESMTP id 1B4158FC28; Thu, 27 May 2010 06:24:51 +0000 (UTC) Received: by pzk13 with SMTP id 13so5422650pzk.13 for ; Wed, 26 May 2010 23:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=hLrrjWxwIZsdSlMDGWSe8VAyPGC40+D1GdfAqit8mdM=; b=l6kfV1ClV2CzLGbX63Nq3H6v9FW0hChYkZAxGcJF/K0NyKBljyKTZSqWFU2sTLKN6f SsOEsS4C7q/Dl5LMbVWnlxau7BSFf2EswUUTNlr8TneRO3KnQsFhJM4ihxvVZLtSRNsf PI7gBvXeSe35GCdqsguNU2Hd/yNhn6+ydu+sg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=u+IKGo6DkOqblg+aj1IPiCrHLSKsUfhbUUJQzMqXzS/Xi8y7301MpDu3TR2Cb0IW1y MSHTOPvJ2SZV5p0YQUwrE4aD91pLFqdA7ReFdSiE0n8tJ8+OkakslJsPMwybxw/qDZKF 6otv1E66w1AnuPIUWsStNXB816BJhmeCV8Eq8= MIME-Version: 1.0 Received: by 10.142.201.17 with SMTP id y17mr6733307wff.283.1274941490751; Wed, 26 May 2010 23:24:50 -0700 (PDT) Received: by 10.142.172.9 with HTTP; Wed, 26 May 2010 23:24:50 -0700 (PDT) In-Reply-To: <4BFDE4E3.4060300@FreeBSD.org> References: <201005270127.o4R1RPaT016558@svn.freebsd.org> <4BFDE4E3.4060300@FreeBSD.org> Date: Wed, 26 May 2010 23:24:50 -0700 Message-ID: From: Neel Natu To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Neel Natu 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 06:24:51 -0000 Hi Alexander, On Wed, May 26, 2010 at 8:20 PM, Alexander Motin 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: >> =A0 Simplify clock interrupt handling on mips by using the new KPI - tim= er1clock() >> =A0 and timer2clock(). >> >> =A0 Dynamically adjust the tick frequency depending on the value of 'hz'= . Tested >> =A0 with hz values of 100, 1000 and 2000. >> >> Modified: >> =A0 head/sys/mips/mips/tick.c > >> - =A0 =A0 =A0 =A0 =A0 =A0 if (profprocs !=3D 0) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 profclock(TRAPF_USERMODE(tf), = tf->pc); >> - =A0 =A0 } >> + =A0 =A0 timer1clock(TRAPF_USERMODE(tf), tf->pc); >> + =A0 =A0 timer2clock(TRAPF_USERMODE(tf), tf->pc); >> =A0 =A0 =A0 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 > =A0 =A0 =A0 =A0stathz =3D hz; > =A0 =A0 =A0 =A0profhz =3D hz; > there. It is just useless. Better would be to do same as for x86: > =A0 =A0 =A0 =A0profhz =3D timer1hz; > =A0 =A0 =A0 =A0if (timer1hz < 128) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stathz =3D timer1hz; > =A0 =A0 =A0 =A0else > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stathz =3D 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 >