From owner-svn-src-user@FreeBSD.ORG Fri Mar 12 19:29:01 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE3CB1065674; Fri, 12 Mar 2010 19:29:01 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id 66C8B8FC0A; Fri, 12 Mar 2010 19:29:01 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id e21so466157fga.13 for ; Fri, 12 Mar 2010 11:29:00 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.103.86.39 with SMTP id o39mr3151565mul.58.1268422140190; Fri, 12 Mar 2010 11:29:00 -0800 (PST) In-Reply-To: <201003121203.44340.john@baldwin.cx> References: <201003112032.o2BKWTrG089154@svn.freebsd.org> <201003121203.44340.john@baldwin.cx> From: Juli Mallett Date: Fri, 12 Mar 2010 11:28:40 -0800 X-Google-Sender-Auth: 076c9f9306f2a437 Message-ID: To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r205025 - user/jmallett/octeon/sys/mips/mips X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2010 19:29:02 -0000 On Fri, Mar 12, 2010 at 09:03, John Baldwin wrote: > On Thursday 11 March 2010 03:32:29 pm Juli Mallett wrote: >> Author: jmallett >> Date: Thu Mar 11 20:32:28 2010 >> New Revision: 205025 >> URL: http://svn.freebsd.org/changeset/base/205025 >> >> Log: >> =A0 I don't know that a critical section is required here, but if it is = we >> =A0really don't want to get interrupted between reading the counter and >> =A0calculating the ticks. > > In practice I think cputicks are only queried while holding a spin lock (= so > interrupts are disabled). =A0Part of the comment before this is wrong as = the > cputicks are completely divorced from the timecounter code, so the tc cod= e > handling wrapping doesn't help any. =A0However, if there is a way to use = a > single instruction to read all 64-bits of the ticker on mips64, it would > probably be best to add a mips64-specific ticker method and use that for > set_cputicker() instead of this one. Alas, that comment is the only reference I can find to a 64-bit count register on any MIPS platform when I set out looking as I implemented exactly that. I suspected the critical sections were gratuitous, but wanted to at least make the code do look less wrong, even if it is still wrong. Thanks for clarifying that we're always in a spinlock there. Juli.