From owner-freebsd-current@FreeBSD.ORG Mon Dec 6 19:38:12 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BF081065693; Mon, 6 Dec 2010 19:38:12 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6370C8FC17; Mon, 6 Dec 2010 19:38:10 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA14628; Mon, 06 Dec 2010 21:38:09 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4CFD3BA1.8080901@freebsd.org> Date: Mon, 06 Dec 2010 21:38:09 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Jung-uk Kim References: <4CF92852.20705@freebsd.org> <201012061401.17904.jkim@FreeBSD.org> <4CFD34E1.40008@freebsd.org> <201012061429.08085.jkim@FreeBSD.org> In-Reply-To: <201012061429.08085.jkim@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: non-invariant tsc and cputicker X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 19:38:12 -0000 on 06/12/2010 21:27 Jung-uk Kim said the following: > On Monday 06 December 2010 02:09 pm, Andriy Gapon wrote: >> on 06/12/2010 21:01 Jung-uk Kim said the following: >>> :-) Don't get me wrong, I generally agree with you *iff* it does >>> : not >>> >>> hurt too much. Anyway, this issue should be resolved from the >>> root, i.e., kern_resouce.c, if possible. >> >> But what to resolve there? > > Better algorithm for stat. > >> I just want to always have a stable source "cpu ticks", and then >> everything else should just work? > > If we had one, yes. But we don't, at least for old x86 hardware. :-( This sounds contradictory... I don't follow. So, TSC as a direct source of cpu ticks is good enough, but TSC as a source for timecounter acting as a source for cpu ticks is not stable? >> BTW, if someone comes up with a patch for more or less correct >> accounting when "cpu ticks" frequency is allowed to change, then I >> am all for it. But, IMO, it's just easier to use stable "cpu >> ticks". > > If it doesn't hurt too much, yes. Remember the P-state invariant CPUs > are pretty new. Well, not that new in this fast changing world. > SMP-correct TSC is quite rare if there is any. This contradicts my experience. All systems that I could test have "SMP-correct TSC". Yes, they all are 1-2 years old and they all are single-package multi-core systems. I tested only one two-socket machine from perf-cluster and it had more or less "SMP-correct TSC" too. BTW: http://people.freebsd.org/~avg/tsc/ But, this SMP-correctness is not a requirement for the cpu ticks accounting that we are discussing, right? -- Andriy Gapon