Seriously high CPU usage and sluggish operation on new install

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Raife
Level 1
Level 1
Posts: 20
Joined: Mon Aug 14, 2017 8:32 pm

Re: Seriously high CPU usage and sluggish operation on new install

Post by Raife » Fri Nov 03, 2017 9:27 pm

Thanks,

I am currently using Kernel 4.10, but I see versions 4.11 and 4.13 as options in the updater. It's just that my current (and latest) install is nearly perfect (after a warm-boot). So, frankly, I am somewhat reticent to experiment with kernels (and risk breaking my installation) only to have the same problem afterwards, or lose what I have now, and have to start over, again.

There's got to be a simple reason for this problem... if only I can find out what is causing this.

By the way, how do I do a reboot during the grub-boot-process? Should I use a shell-script..? Clearly, if I use a script, I'll have to be careful with my logic. I don't want to get stuck in an endless re-boot loop.

User avatar
Termy
Level 5
Level 5
Posts: 762
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Seriously high CPU usage and sluggish operation on new install

Post by Termy » Sat Nov 04, 2017 5:07 pm

Yeah, you don't want that.

Installing, loading, and switching kernels is very easy and well handled in at least Debian/Ubuntu based systems, in my experience. It's unlikely to cause major issues, and I can confidently say that I could tinker with kernels all day long and lose nothing other than time. When you boot up the machine, you get the GRUB, which you can use to pick which kernel to start the system with.

It's entirely possible to install a kernel and have it refuse to boot; I've had this happen a couple of times, but it was always an easy fix; I just needed to load up a working kernel version at startup, then remove the one which didn't work. A couple of times, it only didn't work because I forgot the headers or something.

Still, that all said, there is a very small chance that the deb package(s) are screwed up, and somehow something goes awry during the installation of the kernel and/or its associated packages. I'd understand if you didn't want to take even this very unlikely risk. I'd say it's unlikely, at least. xD

Anywho, I'm afraid I don't know the answer to your question regarding rebooting from GRUB, but, I can tell you what I would try:

See, I know you can reboot from the bash-like GRUB recovery mode, you just type in reboot. Since the grub startup files seem to use the commands you can enter on the GRUB recovery mode, I imagine just adding "reboot" would work. BUT, it would always reboot and thus you'd be in another pickle (a fixable one, with a LiveCD).

To get around this, my approach would probably be to add the following to /boot/grub/grub.cfg, where the file is on my installation. I'm not suggesting you do this right now, just that it's what I would do. By the way, during updates that file can be changed and updated, so editing that particular file is not a permanent solution. After the line which sets the root variable:

Code: Select all

status_file="/etc/grub_reboot_status"
if ! [ -f "$status_file" ]; then
	rm "$status_file"
	reboot
else
	> "$status_file"
fi
Unfortunately, I have a feeling you only get read access, which means > and rm wouldn't work. Furthermore, I don't even know if even the bash-like recovery mode allows for redirection and even the rm command; it's only a very basic, shell. Still, that would be my attempt. I'd probably first try it from GRUB, before editing the file, to save myself hassle if it goes wrong. I'd press "e" while highlighting the menu item of choice in GRUB.

If that were a no-go, I'd resort to making the same thing happen after Linux has been loaded. I'd use the above code in an sh script, then see if I could run that script from GRUB.

However, it probably wouldn't work, in which case I'd have it run when I logged in, which would sadly take a lot, lot longer, but should work, provided the machine runs well enough to get to that point. xD I'd probably want to actually have the code in the script run in $HOME/.profile, so it's caught before a bunch of other things get loaded; should speed things up too. You can make things run even before you've logged in, but I can't remember exactly how I did it. -_-

Sorry for the long post. Hope it helps at all.
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

Raife
Level 1
Level 1
Posts: 20
Joined: Mon Aug 14, 2017 8:32 pm

Re: Seriously high CPU usage and sluggish operation on new install

Post by Raife » Sun Nov 12, 2017 5:21 pm

I have upgraded my kernel to "4.11.0-14-generic", but I am experiencing no difference in the cold-boot/warm-boot CPU-usage problem. I am beginning to wonder if I could run a long delay during boot to give the machine time to fully initialize the hardware. Or, perhaps I could, somehow, re-initialize everything during kernel-load.

This is maddening. Mint w/Cinnamon in insanely, unbelievably, staggeringly, awesome... after, a warm-boot.

What are the differences, from the kernel perspective, between a warm-boot and a cold-boot? Why won't my laptop just boot and run? And, why can't I actually find out what the CPU is actually being used for, after a cold-boot ("System Monitor" just doesn't show anything useful. Nor, have any of the terminal commands actually shown what is using the resources)?

Something... some process... is clearly running in circles... but only after a cold-boot. This is not just related to my hardware or BIOS, since others (with entirely different hardware) are having the same issue. And, it doesn't actually appear to be related to the DE ("Cinnamon"). Based-upon speeds of actions during boot, it seems to be occurring before the GUI is even loading (the real slow-down seems to occur around the graphical log-in screen). Also, sometimes after a cold-boot, the OS runs great. So, it isn't strictly a cold-boot situation (again, however, I have never observed this high CPU-usage after a warm-boot).

Most of my Mint installs have run awesomely (or, had obvious reasons for any issues that cropped-up). And, most of the other people that install Mint have the same reactions. It seems, however, to be a few people's hardware that is randomly triggering some kind of (seemingly untraceable) bug, at a low level, since re-installing doesn't seem to change anything.

The help I have received here has been simply amazing. Thanks to everybody. And, I haven't given up hope. And, I really do still believe that there is a really simple answer that will make this inscrutable problem simply disappear. I just need a SUPER-GURU, or just the right Google-search, to explain what is happening, or a way to side-step the problem.

User avatar
Termy
Level 5
Level 5
Posts: 762
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Seriously high CPU usage and sluggish operation on new install

Post by Termy » Sun Nov 12, 2017 8:20 pm

:(

You mention the login screen. If you want, you could install and use a super light display manager called xdm (should be available for you). I use it sometimes myself. If your experience is super awesome after using that, it could be that your DM is at fault after all.

Install xdm: sudo apt-get install xdm
Back up system file: sudo cp /etc/X11/default-display-manager{,.bak}
Edit system file: echo "/usr/bin/xdm" | sudo tee /etc/X11/default-display-manager

Then reboot. You should then see a super-fugly log-in screen. Log in and basically just use the machine to see what happens.

To undo those changes:

Remove xdm: sudo apt-get remove xdm
Restore backup: sudo mv /etc/X11/default-display-manager{.bak,}

If this works, at least it'll let you use the machine properly. Don't remove the other one though, at this point, just in-case. (paranoid xD) You can always go back to lightdm if you're using mdm at the moment, or try another one like sddm if you're using lightdm at the moment. Typically, sddm is found in KDE, although I'm not sure how that goes with Mint; very pretty, but brings in a lot of stuff, even if you specify not to install with the recommended packages, IIRC.
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

Raife
Level 1
Level 1
Posts: 20
Joined: Mon Aug 14, 2017 8:32 pm

Re: Seriously high CPU usage and sluggish operation on new install

Post by Raife » Sat Nov 18, 2017 4:58 pm

I installed XDM (and then restored LightDM) twice... just to be sure I did it right, and the laptop continued to function Identically as before (CPU usage at around 20% after a reboot, around 95% after a cold-boot). I do think this was definitely worth trying. Of the four parts of the OS (kernel, Gnu/Linux OS, Desktop Manager, GUI/Desktop-Environment) I think I can now rule-out the DM from Mint-18.x -w/Cinnamon.

Also, the behavior after my trying the Cinnamon-DE resets, seemed to have no effect on the problem. So, now I am hoping to find a kernel-switch that will let me try resetting my laptop's hardware-components during boot. I also am considering installing "MATE" alongside "Cinnamon", just to see if it [Mate] has the same problem. If it does exhibit the same behavior, then that would tend to point to the core-OS as the source of this issue.

User avatar
Termy
Level 5
Level 5
Posts: 762
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Seriously high CPU usage and sluggish operation on new install

Post by Termy » Sun Nov 19, 2017 3:35 pm

That's quite a lot of things which seem to be ruled out, now. Perhaps it's just something with your hardware which just isn't supported in Linux, or for some reason in Mint or Debian or Ubuntu, whichever. :(

Did you ever try an older kernel? I'd try 4.4, then try 4.8. Sometimes using an older kernel is the only way to just get your hardware to work. I know someone who needs to use an older kernel for their wireless to work with their laptop, for example. You'd probably lose a lot of security or other benefits though. Hope the thing with Mate works out.
Here to help.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/channel/UCfp-lN ... naEE6NtDSg
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife

Raife
Level 1
Level 1
Posts: 20
Joined: Mon Aug 14, 2017 8:32 pm

Re: Seriously high CPU usage and sluggish operation on new install

Post by Raife » Wed Oct 17, 2018 9:56 pm

I recently bought an HP laptop and installed Mint 18.3 to see how well it would run the OS after all of my troubles with the Toshiba laptop. Long story, short... it runs great. It is configured, and loaded with all of my software and, at this point, I am thrilled. Not that there weren't a few bumps. For example; for a while I started experiencing, random, complete system crashes/freezes during media playback (I literally had to crowbar the laptop's power to restart the system after hangs). I experienced this for about a month, but after a kernel update, and a "software center" "FFMPEG" update the problem went away completely. So, this newer laptop is now my main laptop. I'm not sure which... or, if both updates, resolved the issue.

Now, as to my older Toshiba laptop with the crushingly-high CPU usage after a cold-boot. I decided to install a new hard-drive, and install Mint-19, to see if there was any difference.

In order to install the OS, I had to run the installer without giving it WiFi access (this is apparently a known bug that can prevent successful installation of Mint-19... which it did prevent on the Toshiba laptop). After I installed Mint-19, I had to set the kernel-level chipset-hardware resets, to insure that Mint (an UBUNTU derivative) wouldn't randomly fail to properly initialize the keyboard and touchpad (also, a known UBUNTU issue with this particular Toshiba laptop).

After installation, Mint-19 ran great... cold-boot, or warm-boot... until I used the WiFi. Then I had the exact same problem... namely, more than 90% CPU usage with nothing running after a cold-boot, but very low CPU usage after a warm boot. So, I turned the WiFi off and Mint-19 ran great again... warm, or cold, boot. I turned the WiFi back on and the exact same high CPU-usage problem occurred. So, clearly, the problem resides with this laptop, Mint 18+, and WiFi.

Any ideas? I know this is an obsolete (at this point), and now unsupported, laptop, but I would still like to use this particular laptop (it runs Mint awesomely... after a warm boot, and it has a great display and software setup). However, I need both WiFi enabled, and for the laptop to just run without needing a warm-boot, every time I use it. Also, it should be noted, that (during researching this problem) I have run across this exact "high CPU-Usage" phenomena being reported by others, on several widely different laptop models, from different manufacturers. So, it isn't just my system, model, or configuration.

Sorry, for this issue running for so long, but I do appreciate all the help and suggestions that I have received so far. I have learned so much from my experience, and travails, with Mint.

Post Reply

Return to “Newbie Questions”