Tech Blog

PiklesOnFire's Tech Postings

Ubunut Intrepid - Clocksource From Hell

, , , , , , , , , , , , , , , , , , , , , , ,

So, this is my second time trying to write this article. I'm sad to say the issue I thought was the cause was not the only culprit. I am happy to report now though that everything is stable, and I'm pretty pleased witht the overall progress of my Desktop coming together. I should probably explain that there is a pretty major issue with the clocksource Ubuntu is using, hpet. This particular clocksource was the cause of my system freezing every ten minutes or so. To be totally honest, it could have been the issue in Core 10 as well, but I was less tolerant with Core 10 and did not check the logs, so there is no way for me to be sure. To see if the clocksource is the cause of the issue on your system is simple. Navigate your way to [menu] -> System -> Administration -> System Log. If you look at the messages or kern.log sections and search for "hpet" (no quotes) and see results like this filling the page:
Dec  6 15:47:13 P0F kernel: [  163.857342] CE: hpet increasing min_delta_ns to 15000 nsec
Dec  6 15:47:14 P0F kernel: [  164.653250] CE: hpet increasing min_delta_ns to 22500 nsec
Dec  6 15:50:18 P0F kernel: [  348.432089] CE: hpet increasing min_delta_ns to 33750 nsec
Dec  6 15:52:04 P0F kernel: [  454.148092] CE: hpet increasing min_delta_ns to 50624 nsec
Dec  6 15:52:59 P0F kernel: [  509.009124] CE: hpet increasing min_delta_ns to 75936 nsec
Dec  6 15:53:45 P0F kernel: [  555.721382] CE: hpet increasing min_delta_ns to 113904 nsec

That's a good indicator that hpet is the cause of the issue, or at least a factor.

Now then, for a short guide and an explanation ;]

So how do we get our system stable? Or hopefully bring it a step closer to stability? Well, it's a pretty simple process.

WARNING: I can not stress this enough, you will be modifying critical system files. If something goes wrong, I take no responsibility. Again, if your system gets hosed because you followed this guide, I am not responsible

With that warning out of the way, I'd like to say, that no matter what, unless your system freezes in the midst of us updating the bootloader or something catastrophic like that happpens, your system should be fine.

On to the solution.
The first thing we need to do, is become root. Run the following command:
sudo -i


Enter in your password. Now you should see something similar to the following:
root@localhost:~#
see note 1

Now that we're root we'll start applying the fix. We first need to modify the bootloader, grub. To do this, run the following command:
gedit /boot/grub/menu.lst
see note 2

Locate these two lines:
# defoptions=quiet splash

# altoptions=(recovery mode) single
see note 3

And modify them so that they look like this:
# defoptions=quiet splash hpet=disable

# altoptions=(recovery mode) single hpet=disable


Now save and close the file and issue the following command to update the bootloader with the changes:
update-grub


Lastly, issue the following command:
rm /boot/grub/menu.lst~
see note 4

Type
exit
to drop from root, and restart your system.


If all went well, your system should no longer hang. If it still does, read my next post about FGLRX and how it may save the day.

I'd like to explain what exactly the "hpet=disable" option does. It tells the kernel to disable the HPET timer source and tell the kernel to use the PIT timer source instead. - That is according to this document Kernel Boot Command-Line Parameter Reference : pdf document

I'd like to also mention, that I had Googled this issue, and did see a resolution on one of the bug tracking websites, it was to use the option "clocksource=jiffies" however, this option caused my Xorg to unexplainably stop loading.

Notes:
Note 1: The important part here is that we see "root" this indicates that you have sucessfully become the administrator on your system.

Note 2: I issue the command gedit because I'm on the default Ubuntu install. If you were on Kubuntu it would be kate, and Xubuntu mousepad, respectively. Also, the command line tools vim or nano are always good options if you feel comfortable working in them.

Note 3: Your lines may not match exactly to mine. Again, just look for the key parts here, "# defoptions" and "# altoptions".

Note 4: This command is actually an optional "clean up" command, it removes the temporary file that was created while we were working in gedit. I mention to run it last in case you system hangs in the process of working on these files, if something goes terribly wrong, hopefully you'll have this backup copy until we no longer need it.



Goodluck and Happy Hacking ~
PiklesOnFire

Ubuntu Intrepid Ibex - Getting BetterUbuntu Intrepid - Clocksource Fixed, System Still Hangs, AND No Videos - FGRLX Fixes It

Comments

Unregistered user Monday, February 2, 2009 5:25:07 PM

Anonymous writes: hi. are those options supposed to realy stay commented out?

PiklesOnFire Monday, February 9, 2009 8:11:30 PM

Hi reader! yes, those options are to remain commented out. They are not standard GRUB options, but rather used by the script "update-grub" provided by Ubuntu.

Hope this helps.

PiklesOnFire

Unregistered user Wednesday, February 11, 2009 3:59:37 PM

Tim Hughey writes: Thanks for this great write up. Turns out that the issues with HPET were causing both IO errors while writing to disk AND problems managing the wireless interface hardware. Truly nasty stuff.

PiklesOnFire Wednesday, February 11, 2009 11:20:23 PM

Indeed. I wonder why it is this issue shows itself on Fedora. I haven't seen it on Gentoo or Arch or any other distro that also enables the HPET timer.

Very strange and nasty stuff.

PiklesOnFire

Unregistered user Tuesday, May 5, 2009 12:19:49 AM

Iced Guardian writes: Hey Pickles! I have a huge problem with my HP DV4 1220us. I followed your instruction and everything went well... I mean, nothing really happened. The problem with this machine is the following: I can't copy anything bigger than 1GB to my pendrive; I can copy anything from my pendrive to my computer, but not viceversa... this is so strange... help please? http://ubuntuforums.org/showthread.php?t=1148922&highlight=hp+dv4+1220us

Unregistered user Monday, June 8, 2009 10:38:17 PM

Alain Bequer writes: Hi, Excelent post. I had the same problem in Ubuntu 8.10 with ATI module installed for my ATI Raedon 1200 and wl module for my BCM4312 wirless adapter. Regards!!!

Unregistered user Thursday, June 18, 2009 8:16:49 AM

Anonymous writes: Finally I got to know how to disable the bugger! Thanks!!

Unregistered user Monday, November 23, 2009 6:14:36 PM

Lian writes: I am on Ubuntu 9.10 (kernel 2.6.31-14-generic) and have this same problem. I'd like to point out that I do not have a /boot/grub/menu.lst file. There's a file /etc/default/grub and I edited the line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash hpet=disable" I think it has the same effect as your instructions. Someone mentioned that there are IO errors caused by HPET. I did noticed that sometimes when I edit my Startup Applications, they would revert back when I restarted. Related?

Unregistered user Monday, May 3, 2010 2:42:11 PM

Anonymous writes: And the damn developers aren't doing anything to solve the problem... see https://bugzilla.kernel.org/show_bug.cgi?id=14426 I say disable hpet in the kernel and go back to 8254.

Unregistered user Thursday, May 6, 2010 7:43:00 PM

Pétur Ingi writes: This bug is affecting my openSuSE 11.2 system. 2.6.31.12-0.2-desktop #1 SMP PREEMPT 2010-03-16 21:25:39 +0100

Unregistered user Sunday, May 29, 2011 4:02:57 PM

Anonyme writes: Hi I unfortunately have this problem too, on Ubuntu 10.4. I could not use your workaround, as I have the grub 2 version, with no menu.lst... Any idea how to do with grub 2? Thanks!!

Unregistered user Wednesday, July 13, 2011 2:34:02 AM

Tanay Mathpal writes: I am having the same freezing problem in my Ubuntu and am getting the same hpet increasing messages in my logs. I will implement your solution today and will reply with the results. Hope it works!

Write a comment

New comments have been disabled for this post.