From owner-freebsd-arch@FreeBSD.ORG Tue Mar 5 09:22:02 2013 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0391ABE; Tue, 5 Mar 2013 09:22:02 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com [IPv6:2a00:1450:4010:c03::230]) by mx1.freebsd.org (Postfix) with ESMTP id E6881D50; Tue, 5 Mar 2013 09:22:01 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id fq13so5953668lab.35 for ; Tue, 05 Mar 2013 01:22:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=q7SL+gQX2m2dS5aMqlhn52ZSx8c51ttNydnBpFiRxwg=; b=Im5kRioHWRvaFPpI2XeFiI6OeekQxEzmmpzSxsJfOwdgUqxdb6GaAUW+TuQAfEpd/Y 5gPuIN8X/XLmsd9zY0ayxD5uz7aoHa5RPb0jwwRO6brc/+pivfYk/P3yE27rkAckKyP6 AJclmrbyMOfgnwGW6pRIJDMg1Uad45JKEQeyqF/0CaVYKwKAXLRXuhV9bez5SzytQalT eHXBZDmjmR4A3mf1/CZX9sDtKsf1XHIbBXCuWP7oW2u8T4JV0hjUHNgpSvLxAgy3zgl1 HCvYXz0AtnA31tKgUk46PjmKMFqzFSa6z5/OZkojYKbQXTORP7RsqdUarEUgguGt/riU J/Hg== X-Received: by 10.112.98.227 with SMTP id el3mr5452790lbb.131.1362475320802; Tue, 05 Mar 2013 01:22:00 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id q9sm8313676lbz.3.2013.03.05.01.21.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Mar 2013 01:21:59 -0800 (PST) Sender: Alexander Motin Message-ID: <5135B934.5060202@FreeBSD.org> Date: Tue, 05 Mar 2013 11:21:56 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130125 Thunderbird/17.0.2 MIME-Version: 1.0 To: Luigi Rizzo Subject: Re: tickless design guidelines References: <20130305080134.GC13187@onelab2.iet.unipi.it> <5135AFAD.70408@FreeBSD.org> <20130305090735.GB18221@onelab2.iet.unipi.it> In-Reply-To: <20130305090735.GB18221@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Davide Italiano , arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 09:22:02 -0000 On 05.03.2013 11:07, Luigi Rizzo wrote: > Also i wonder if it may make sense to add a feature so that whenever > we get an interrupt and a fast and suitable timecounter is available, > some system-wide bintime is updated. > > So getbinuptime() could just use this counter, becoming extremely > cheap (perhaps it is already, i am not sure) and in the long term, > as CPUs with fixed frequency TSC become ubiquitous, > we would get higher resolution as the interrupt load increases. Each time timer interrupt fires, or CPU timers "switched" between idle and active modes present time is fetched. The only question is how to store it somewhere safely. It was difficult for 96/128-bit struct bintime. It is easier for 64-bit sbintime_t, but still not all archs are able to do it atomically. The mechanism used for getbinuptime() now may not scale well to the very high update rates. -- Alexander Motin