From owner-freebsd-mips@FreeBSD.ORG Tue Jul 27 15:40:42 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95B391065678; Tue, 27 Jul 2010 15:40:42 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4AD028FC12; Tue, 27 Jul 2010 15:40:42 +0000 (UTC) Received: by pwj9 with SMTP id 9so596621pwj.13 for ; Tue, 27 Jul 2010 08:40:41 -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=U/ufVlYPHTmUuRU7pVDjdSr0HyjcPh/pGjQsrg/WC7c=; b=uIFCh+nXPhrylfILS5CrGhbDam8m3UpETo8N2CPviqi9Tf6ZGJ0zBZ2tvHBRiF+aOb A4PdRUM9F6sIHGGtGrDdU6vB63bNf39Y4MXqPgS4RihQOe8UF5FrnNi29U5wR4uVHEIi 4y3sju4ad3s+BhnONjZjXfnYZfDgozmIeEA04= 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=qIMhco8U4TFay5e0iMzc13ede0wQ2dUsIREOqlGq4kaH2XdkAniXKl1Wo27QSQiWB7 qTGxES47uYv0+oERcE0WtaOD4WXw6+4c2VSnI3jzTNa7f8b1TaDzZuDY0ya5gGY0W5DM XDhYybRGGMsCESlaWgrJjMXpBDarb4OkD8yBY= MIME-Version: 1.0 Received: by 10.142.246.20 with SMTP id t20mr4715508wfh.199.1280245241557; Tue, 27 Jul 2010 08:40:41 -0700 (PDT) Received: by 10.220.195.11 with HTTP; Tue, 27 Jul 2010 08:40:41 -0700 (PDT) In-Reply-To: <4C4EF842.5020103@FreeBSD.org> References: <4C41A248.8090605@FreeBSD.org> <4C41B4CF.6080409@FreeBSD.org> <4C4205CC.6080700@FreeBSD.org> <4C4ED247.80701@FreeBSD.org> <4C4EF398.1050507@FreeBSD.org> <4C4EF842.5020103@FreeBSD.org> Date: Tue, 27 Jul 2010 21:10:41 +0530 Message-ID: From: "Jayachandran C." To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Randall Stewart , Neel Natu , freebsd-mips@freebsd.org Subject: Re: [RFC] Event timers on MIPS X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2010 15:40:42 -0000 On Tue, Jul 27, 2010 at 8:46 PM, Alexander Motin wrote: > Alexander Motin wrote: >> Jayachandran C. wrote: >>> On Tue, Jul 27, 2010 at 6:04 PM, Alexander Motin wrot= e: >>>> Jayachandran C. wrote: >>>>> Also, with just the count/compare, I get these print on early mutiuse= r bootup. >>>>> --- >>>>> calcru: runtime went backwards from 85936878 usec to 236488 usec for >>>>> pid 1286 (rpcbind) >>>>> calcru: runtime went backwards from 7158742 usec to 19700 usec for pi= d >>>>> 1285 (nfsiod 0) >>>>> calcru: runtime went backwards from 111005442 usec to 305474 usec for >>>>> pid 1257 (syslogd) >>>>> calcru: runtime went backwards from 10740196 usec to 29555 usec for >>>>> pid 1048 (devd) >>>>> -- >>>>> Did not get much time to investigate, any idea what the cause =A0can = be? >>>> I think it can easily be result of broken tick_ticker(). >>> I'm planning to check-in the attached patch for mips/rmi, I think >>> mips/mips would need something similar. >> >> Looks fine. Does it help? > > Sorry, after looked again, I've got one question. Why this: > > + =A0 =A0 =A0 DPCPU_SET(counter_upper, t_upper); > + =A0 =A0 =A0 DPCPU_SET(counter_lower_last, t_lower_last); > > was moved out of the critical section? Due to the per-CPU nature of this > function it probably always called inside critical section, so there is > no problem I think. But IMHO either critical section calls there are > unneeded, or above sets and mips_rd_count() worth moving inside of it. I missed the critical section, I will move the DPCPU_SET and into the critical section, since it is an obvious mistake I introduced. There is a critical_enter/exit in cpu_intr too, with mips_rd_count() outsid= e.. Thanks, JC.