From owner-freebsd-sparc64@FreeBSD.ORG Tue Jul 20 18:32:38 2010 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D438106564A; Tue, 20 Jul 2010 18:32:38 +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 C35A88FC16; Tue, 20 Jul 2010 18:32:37 +0000 (UTC) Received: by fxm13 with SMTP id 13so3388348fxm.13 for ; Tue, 20 Jul 2010 11:32:36 -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=xgUQxj5AUUMekdLBmh6iqo2GWkNHQb/2lAqQOU5tqbc=; b=RmsPVTSJVZFuz2dgM6PVF/PpOT+uQX1owNb3JV4hePlqjmWNwZhBh3B3B9z4EvDlon NmIlAccA9cr86LGd4VUYio+/8p1iRt5vseo/Mei2szO9DqPGe3VWCCH5xGa2XrEgF1q/ GxtCsojDL5x768E4rtNlc7NTvAg2AnKmNbHQE= 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=xPxF+gYM1ltS2+rHGpW7hiYKdgMCOujPNLj9xtuab1NzQNw45iw2/HQPBSRMo2Ln0N t0McoOuUx/8RAjDN46+JlsTrwAbDhr+DP62hbIM48fc3zmF4SvIk/J0RFo927IS4HzC+ gfcXgks96wN3bfsuutMBZrGOchCPeKjHmBUjc= Received: by 10.223.122.148 with SMTP id l20mr5789742far.84.1279650756472; Tue, 20 Jul 2010 11:32:36 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id m3sm2551637fai.17.2010.07.20.11.32.33 (version=SSLv3 cipher=RC4-MD5); Tue, 20 Jul 2010 11:32:34 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C45EBBE.50502@FreeBSD.org> Date: Tue, 20 Jul 2010 21:32:30 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: John Baldwin References: <4C404018.6040405@FreeBSD.org> <4C41D99B.10202@FreeBSD.org> <20100718140508.GX4706@alchemy.franken.de> <201007201354.02827.jhb@freebsd.org> In-Reply-To: <201007201354.02827.jhb@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-sparc64@freebsd.org, Marius Strobl Subject: Re: [RFC] Event timers on sparc64/sun4v X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 18:32:38 -0000 John Baldwin wrote: > On Sunday, July 18, 2010 10:05:08 am Marius Strobl wrote: >> Apart from that I'm not really happy about that construct >> myself but I don't see an alternative to always bind to >> the same CPU when reading the tick counter in order to >> get reliable results and in US-IIIi-based machines there >> just isn't another piece of hardware besides the per-CPU >> stick and tick counters that could be used as a timecounter >> available. > > You could check td_critnest perhaps in your routine and if it is non-zero just > return the cached value of the timecounter from the last time it was polled > from tc_ticktock() (effectively turning those instances of getfootime() into > just footime()). Things like gettimeofday() would still be correct as they > can safely bind to the BSP, and I doubt many interrupt handlers are actually > using getfootime(). Thinking about tickless kernel and looking how it is done in Linux I have feeling that we may need to call getbinuptime or something alike in the interrupt threads to properly schedule events. At this moment I don't see another way to avoid time drift due to interrupt latency and other delays. That's why I would like this issue to be fixed in some better and less consuming way. May be using per-CPU ticker could help at that specific question, but I still don't like the situation. In future it may be not very good to wake up exactly CPU0 from sleep just to update system time for other cores, as it is done now. -- Alexander Motin