Linux kernel hangs at 'Switching to clocksource tsc" on Pentium 4

11

3

Hardware: Dell Dimension 4500S : i845G, Pentium 4, stock + 2GB RAM and latest (circa 2002) BIOS update.

I've been building a Linux system from source, so far it's LFS 7.0 by the book. The first kernel I built works fine, but has alot of fluff and bloat, so I'm now optimizing the kernel for my target hardware (see above).

My latest configuration attempt, and several trial and error variations, have been continually hanging at the printk "Switching to clocksource tsc" statement. My "good" kernel never has had an issue...this is version 3.1.0 btw. Both are being built from the same source tree, no patches, make mrproper, make menuconfig, etc, so obviously I'm just missing some key CONFIG_XXX flag.

I've been staring at this problem for over a day now, and I've built the kernel who knows how many times, but to no avail.

One thing that I find interesting is with the good kernel I get:

# cat /sys/devices/system/clocksource/clocksource0/current_clocksource
tsc

also, it might be useful to know....

# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc acpi_pm

I'v attempted the build configuration with various options, but at this point I can't remember any specifics so please don't ask. From my searching I've found and tested several kernel parameters, like clocksource=pit and notsc, but all of these fail as well. Again, I wish I had written down every thing I've tried so far, hindsight...

Most of the forum examples are for 2.x kernels and were solved with some variation of the boot options, but my good kernel uses only root=/dev/sdaX ro. So I know I'm golden with this hardware and kernel 3.1.0 combination if I can find the right build configuration.

Also, most of the people out there that have posted a similar issue say that after a few minutes the system will continue loading and everything is peachy. I've let it idle long enough to cook supper and it still hasn't resumed loading.

I'm hoping one of you guru's will read this and say "hey yeah I just set CONFIG_XXX=y on my P4 dinosaur and it worked great." :)

Let me know what you need me to try or check, I'll be happy to post the results.

rfmodulator

Posted 2012-01-16T07:28:11.373

Reputation: 111

@tripleee Where can I view that information...the reason behind a close vote? – rfmodulator – 2012-01-16T08:03:32.967

Maybe you can't, your reputation may not suffice. Anyhow, since this isn't programming-related, it makes sense to move, but all it takes are a few more close votes. I'll add mine as well. – tripleee – 2012-01-16T08:09:29.470

I am facing similar issues with the new kernel with Pentium 4. Everything works if I disable hyperthreading. Spent two nights debugging, not sure about details yet. – choroba – 2012-01-16T13:02:35.363

@choroba noht doesn't do it for me. Let me know if you have other ideas. – rfmodulator – 2012-01-16T22:01:51.293

In fact, I had to switch off ht at BIOS level, or specify acpi=off. – choroba – 2012-01-16T22:32:29.987

@choroba My BIOS doesn't have the ht options, but even if it did I'm puzzled about why my first kernel configuration boots fine with no special parameters or BIOS settings. I'm not really looking for a work around, as much as what I'm doing wrong. – rfmodulator – 2012-01-16T23:24:04.190

>

  • A custom kernel'll likely start faster but not run measurably faster. Your free RAM will hardly go up. So building a custom kernel is unworthwhile here, except for learning.
  • As Gilles writes: Only the modules for your hardware get loaded. And most of the optional features were made optional for embedded customers, not us.
  • May I suggest you go back to your working kernel.
  • BTW what does "alot of fluff and bloat" in your question mean?
  • – unforgettableidSupportsMonica – 2012-03-28T04:19:56.070

    @unforgettableid 1. Doesn't answer my question. 2. See 1. 3. No. 4. It's irrelevant. – rfmodulator – 2012-03-28T09:52:20.277

    Answers

    8

    From a quick search this problem seems to have quite many possible reasons, and seems to point to the fact that your new kernel's default for clock-source is wrong for your motherboard.

    One advice that worked for some was to use clocksource=hpet or clocksource=acpi_pm.

    In another thread, someone fixed this with clocksource=jiffies, another advised to try noapic or nolapic, another to turn acpi off in the BIOS, and still another blamed the Synaptics touchpad and fixed his problem by deleting Xorg.conf.

    One kernel builder fixed his problem by recompiling initrd without fbcondecor.

    Hope this helps, as it seems that this problem can have many causes.

    harrymc

    Posted 2012-01-16T07:28:11.373

    Reputation: 306 093

    Thank you for your answer, however I'm seeking kernel build configuration options that will cause (or prevent) the hang at boot time that I am observing, not a work around. I have tried all of the relavent boot parameters (clocksource=, no*, etc.) that were noted in various forum threads, with no effect. I did these expriments in an attempt to narrow down my real issue. I already have a kernel that boots perfectly without any special parameters (aside from root= and ro) built from the same source tree, but this kernel contains more things that I don't need, than those that I do... – rfmodulator – 2012-01-23T10:10:51.210

    ...except that one key CONFIG_ flag that will solve my issue. – rfmodulator – 2012-01-23T10:12:41.807

    Is it possible that your problem is that you have turned off too many kernel options ? – harrymc – 2012-01-23T10:13:28.387

    Precisely. :) That is the answer I'm looking for, what have I disabled that is actually needed. I've done this several times with no change in the outcome. – rfmodulator – 2012-01-23T10:18:49.757

    I can't help you with one magic word. It seems like your current clocksource is acpi_pm, but you will need to delve into the kernel's sources to find out with kernel config you loused up. The other option is to return to the configuration that worked and turn off options in increments so as to locate the problem. To "cheer" you up I can also say that this might not be one option but several, meaning a conflict or a non-viable config combination or non-documented dependency. – harrymc – 2012-01-23T10:31:29.713

    My current clocksource is tsc by default (I mentioned this in the OP), but acpi_pm also works on the good kernel if I explicitly specify it. I understand what you're saying, please try to understand what I am asking and the scope of my request. I offered the bounty to avoid "debugging" in the kernel source. In all honesty, the person who is awarded this bounty is probably going to be someone who has solved this issue before, or a Linux kernel guru who just knows. Thank you for your attempt however. Cheers! – rfmodulator – 2012-01-23T10:40:16.643

    Even a Linux kernel guru will need to know what config changes you have done, so better add that info into the post. – harrymc – 2012-01-23T11:23:19.333

    A kernel guru will be aware of the options that are relavent to the clock and can point me in the right direction, or will at least ask good questions to obtain more information. I'm willing to test anything, so long as it is pertinent to my question. Although I do wish SE had file attachments, it would be great if I could just upload my .config file, but I think I'll skip posting the entire contents. :) However if any specific flags or sections are needed, I'll be happy to provide those. Anyway, thanks again, and if you come up with an answer feel free to post it. – rfmodulator – 2012-01-23T12:02:38.637

    File attachments can be posted on pastebin or whatever. But even with it your info may be too vague to get an answer, so you may need to specify what you changed.

    – harrymc – 2012-01-23T14:01:35.123

    Yeah I'm aware of 3rd party file hosting sites, I could post it on my own site too, but that's not the avenue I'm looking for. In certain situations file attachments would be a very useful feature for SE. So the entire .config file would be too vague. lol Now you're just being funny. – rfmodulator – 2012-01-23T14:31:29.240

    0

    I got the exact same problem here and read a LOT. @harrymc did a pretty good summary.

    I will just add 2 things I learned from my research:

    • The problem comes from your Linux kernel which does not know how to handle your processor because it cannot figure out what's your processing clock. You can observe this by checking out the kernel boot log. It looks like the kernel is trying to measure your processing clock (for me it was like "2997.1333" but every boot changing to "2997.1445", "2997.1379", ...).

    • After trying a lot of things, I finally got here and find out about the BIOS. Mine is GYGABITE UEFI. I set parameters back to "Optimized default settings" and set "Intel Virtualization Technology" to "enabled".

    Now, everything is back to normal for me! Hopes this helps.

    MaximeBernard

    Posted 2012-01-16T07:28:11.373

    Reputation: 101

    0

    A few cents from me, not sure if it's a common thing or not but I was able to make Ubuntu work by disabling 'high precision timer' in BIOS. My mb is gigabyte z77x-d3h

    Oxy

    Posted 2012-01-16T07:28:11.373

    Reputation: 11

    The OP's system doesn't support the High Precision Event Timer. That was introduced in 2005, and the original poster's system predates that by several years. – ChrisInEdmonton – 2015-06-15T21:30:14.027

    -2

    I fixed the problem by adding following kernelparameter:

    noapic
    

    Kiroe

    Posted 2012-01-16T07:28:11.373

    Reputation: 1

    5Welcome to Super User. Can you expand your answer by explaining what this does/how it solves the OP's problem? – I say Reinstate Monica – 2018-07-03T01:29:33.773

    no sry, just played around with the kernel parameters. – Kiroe – 2018-07-03T08:51:06.937