NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/45626: System time does not advance correctly when noatime is specified for /var



The following reply was made to PR kern/45626; it has been noted by GNATS.

From: Donald Allen <donaldcallen%gmail.com@localhost>
To: Manuel Bouyer <bouyer%antioche.eu.org@localhost>
Cc: gnats-bugs%netbsd.org@localhost, kern-bug-people%netbsd.org@localhost, 
gnats-admin%netbsd.org@localhost, 
        netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/45626: System time does not advance correctly when noatime
 is specified for /var
Date: Fri, 18 Nov 2011 13:47:41 -0500

 On Fri, Nov 18, 2011 at 10:06 AM, Donald Allen 
<donaldcallen%gmail.com@localhost> wro=
 te:
 > On Fri, Nov 18, 2011 at 9:33 AM, Manuel Bouyer 
 > <bouyer%antioche.eu.org@localhost> w=
 rote:
 >>
 >> On Fri, Nov 18, 2011 at 01:25:03PM +0000, Donald Allen wrote:
 >> > =A0[...]
 >> > =A0sysctl -a | grep kern.timecounter
 >> >
 >> > =A0which I did:
 >> >
 >> > =A0kern.timecounter.choice =3D TSC(q=3D3000, f=3D67750617510 Hz) clock=
 interrupt(q=3D0,
 >> > =A0f=3D100 Hz) ichlpcib0(q=3D1000, f=3D3579545 Hz) hpet0(q=3D2000, f=
 =3D14318179 Hz)
 >> > =A0ACPI-Fast(q=3D1000, f=3D3579545 Hz) lapic(q=3D-100, f=3D266097187 H=
 z) i8254(q=3D100,
 >> > =A0f=3D1193182 Hz) dummy(q=3D-1000000, f=3D1000000 Hz)
 >> > =A0kern.timecounter.hardware =3D TSC
 >> > =A0kern.timecounter.timestepwarnings =3D 0
 >>
 >> TSC is clearly wrong here, I'm sure you don't have a 67Ghz CPU :)
 >
 > That's certainly true.
 >
 > I've got NetBSD installed next to Slackware Linux on this machine,
 > running the 3.0.8 kernel from kernel.org. I've had no problem with
 > time-keeping in Linux on the machine, so out of curiosity, I brought
 > Linux up and had a look at the dmesg:
 >
 > dca@salome:~$ sudo dmesg | fgrep TSC
 > [ =A0 =A00.000000] Fast TSC calibration failed
 > [ =A0 =A00.000000] TSC: PIT calibration matches HPET. 1 loops
 > [ =A0 =A01.336163] Refined TSC clocksource calibration: 2393.976 MHz.
 >
 > I could be wrong, but that suggests to me that the Linux kernel
 > noticed the TSC oddness and somehow compensated. Perhaps a look at
 > what they're doing is in order.
 >>
 >> >
 >> > =A0He also suggested trying
 >> >
 >> > =A0sysctl -w kern.timecounter.hardware=3Dhpet0
 >> > =A0>
 >> > =A0> and see if that fixes it.
 >> > =A0>
 >> >
 >> > =A0It does:
 >> > [...]
 >> > =A0However, after doing this, the system behaved in odd ways. I had tr=
 ouble
 >> > =A0shutting X down, the system seemed not to be hearing the (USB) keyb=
 oard (I
 >> > =A0couldn't log in after doing ctrl-alt-f2). I finally got it shut dow=
 n and
 >> > =A0rebooted, ending this experiment.
 >> >
 >> > =A0I then decided to try a newer kernel, and installed the kernel from=
  the
 >> > =A011/17 snapshot. Upon booting the system this morning (with all the =
 file
 >> > =A0systems, including /var, mounted async,noatime), I quickly observed=
  the
 >> > =A0clock problem.
 >>
 >> You should try setting
 >> kern.timecounter.hardware=3Dhpet0
 >> in /etc/sysctl.conf, so that the change is applied at boot.
 >> The odd behavior you see may be caused by processes started before
 >> the timecounter change.
 >
 > That makes sense.
 >
 > I've made the change you suggested to /etc/sysctl.conf and brought the
 > system back up. I will use it for my work today and keep an eye on the
 > time-keeping. So far it's working fine.
 
 The system has been up almost four hours and time-keeping is working
 fine, so your suggestion to switch to another source of ticks has
 fixed my problem.
 
 I'd also like to mention that I've had this machine for a few years
 now, and, in addition to Linux, I have tried OpenBSD and FreeBSD on it
 (both of which were abandoned for good reasons, which I won't go into
 here). I had no problems with time-keeping with them, either. So
 you've got a couple of BSD references, in addition to Linux, for ideas
 on working around the TSC issue.
 
 Again, thanks very much for your help.
 
 /Don
 
 >
 > Thanks for your help.
 >
 > /Don
 >
 >>
 >> You can also try other available timecounters (try ichlpcib0 or i8254
 >> for exampe).
 >>
 >> --
 >> Manuel Bouyer <bouyer%antioche.eu.org@localhost>
 >> =A0 =A0 NetBSD: 26 ans d'experience feront toujours la difference
 >> --
 >
 


Home | Main Index | Thread Index | Old Index