From owner-freebsd-current@FreeBSD.ORG Wed Jun 29 21:50:07 2011 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 B26141065677 for ; Wed, 29 Jun 2011 21:50:07 +0000 (UTC) (envelope-from sendtomatt@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 064688FC0C for ; Wed, 29 Jun 2011 21:50:02 +0000 (UTC) Received: by iyb11 with SMTP id 11so1951863iyb.13 for ; Wed, 29 Jun 2011 14:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=jlxvYmaymh8sGynK2tT3gh0sAiXgpONLohP1OQ6Jr9k=; b=q18KnkgSmrn/9julZGTlZJbDHQ3ngNgpjPjvh9pnuolU9wf4sU3xa142ajYVJ4N+3o WIM8VsBxRYcl8NuPuWNb8Je6sQVRnVxTw+MgN/HRdiXaS0Sh1j5zaMQMml8qT6ZVm9wm rEsXgBieVQUuZ6fM9TQUx8xO4uq+esIedwuJM= Received: by 10.42.240.69 with SMTP id kz5mr1191897icb.263.1309384201896; Wed, 29 Jun 2011 14:50:01 -0700 (PDT) Received: from sidhe.local (adsl-67-118-230-86.dsl.pltn13.pacbell.net [67.118.230.86]) by mx.google.com with ESMTPS id hp8sm1417266icc.23.2011.06.29.14.49.59 (version=SSLv3 cipher=OTHER); Wed, 29 Jun 2011 14:50:00 -0700 (PDT) Message-ID: <4E0B9E08.1090202@gmail.com> Date: Wed, 29 Jun 2011 14:50:00 -0700 From: Matt User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.18) Gecko/20110624 Thunderbird/3.1.11 MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Time keeping Issues with the low-resolution TSC timecounter 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: Wed, 29 Jun 2011 21:50:07 -0000 On 06/23/11 08:25, Jung-uk Kim wrote: > On Thursday 23 June 2011 04:21 am, Ian FREISLICH wrote: >> Jung-uk Kim wrote: >>> On Tuesday 21 June 2011 04:53 pm, Jung-uk Kim wrote: >>>> Can you please try the attached patch? It should disable >>>> TSC/TSC-low timecounter for your CPU models, I think. >>> Sorry, I attached a wrong patch. Please ignore the previous one >>> and try this, instead. >> TSC-low is not presented as an option any more: >> >> CPU: Intel(R) Atom(TM) CPU N270 @ 1.60GHz (1596.03-MHz 686-class >> CPU) Origin = "GenuineIntel" Id = 0x106c2 Family = 6 Model = 1c >> Stepping = 2 >> Features=0xbfe9fbff> R,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> >> Features2=0x40c39d> OVBE> AMD Features2=0x1 >> TSC: P-state invariant, performance statistics >> >> Event timer "LAPIC" quality 400 >> Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 >> acpi_timer0:<24-bit timer at 3.579545MHz> port 0x408-0x40b on >> acpi0 atrtc0: port 0x70-0x77 on acpi0 >> atrtc0: Warning: Couldn't map I/O. >> Event timer "RTC" frequency 32768 Hz quality 0 >> hpet0: iomem 0xfed00000-0xfed003ff irq >> 0,8 on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 950 >> Event timer "HPET" frequency 14318180 Hz quality 450 >> Event timer "HPET1" frequency 14318180 Hz quality 440 >> Event timer "HPET2" frequency 14318180 Hz quality 440 >> attimer0: port 0x40-0x43,0x50-0x53 on acpi0 >> Timecounter "i8254" frequency 1193182 Hz quality 0 >> Event timer "i8254" frequency 1193182 Hz quality 100 >> >> kern.timecounter.choice: TSC(-1000) i8254(0) HPET(950) >> ACPI-fast(900) dummy(-1000000) > It's already committed (r223426). > > Thanks! > > Jung-uk Kim > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > I had been holding off on csup on this machine for a moment: Machine: Thinkpad SL410 Core2Duo T6570 I rm -rf /usr/src& csup'd sources yesterday. Issues still exist with TSC-low on Intel laptop hardware. Quality was set to 1000, but time was inaccurate. Felt like 300 baud serial console over a very long link! I have C2& powerd: /etc/sysctl.conf: ... # Save electricity& thermal hw.pci.do_power_nodriver=3 hw.acpi.cpu.cx_lowest=C2 dev.cpu.1.cx_lowest=C2 dev.cpu.0.cx_lowest=C2 ... /etc/rc.conf: ... #power powerd_enable="YES" powerd_flags="-b adaptive -a maximum" ... I'm getting as far as /usr/src/sys/x86/x86: ... if (smp_cpus> 1) { tsc_timecounter.tc_quality = test_smp_tsc(); max_freq>>= 8; ... test_smp_tsc() returns 1000, allowing TSC-slow to "win". Forcing this to 50 fixed all time/speed issues, allowing HPET to "win". I think the test for C3 above that may need to include additional machines under its protection! I have no C3 support, but it's clear that issues are occuring with TSC clocks even in C2 on intel platforms. Matt