konkor / cpufreq

System Monitor and Power Manager
https://konkor.github.io/cpufreq/
GNU General Public License v3.0
572 stars 59 forks source link

"irqbalance detected" even when irqbalance is disabled #48

Open andy0130tw opened 6 years ago

andy0130tw commented 6 years ago

After updating this GNOME extension I noticed that it start reporting if irqbalance is installed on the device. If so it will replace the loading percentage with a constant, warning message, irqbalance detected.

I then disabled irqbalance through its config file (located at /etc/default/irqbalance) but the message was still there. Stopping the service did not help, either. The comment from the author hinted me that the package should be uninstalled if I saw the message.

I tracked down to the code and located the condition at https://github.com/konkor/cpufreq/blob/7655cccc673df549796e3839a4b30793914263c6/extension.js#L1429, but I think it should be more reasonable to check if this service is running instead of checking its existence. For example, check if ps aux | grep /usr/sbin/irqbalance matches.

konkor commented 6 years ago

@andy0130tw it's a good idea but it's so hard to test even such simple things sometimes (different policies, user permissions, sudo or not...). It'll be in the future releases (ps -A |grep irqbalance) here https://github.com/konkor/cpufreq/blob/7655cccc673df549796e3839a4b30793914263c6/cpufreqctl#L294 You can test it... Just replace in the extension folder (which irqbalance to ps -A |grep irqbalance) and run

sudo ./cpufreqctl install
seb2411 commented 6 years ago

Is IRQ Balance a bad option ? Or something we have to disable ?

konkor commented 6 years ago

@seb2411 in 2 words, my answer - YES! You can freely uninstall irqbalance.

  1. irqbalance doesn't support fully all kernel features to an example a turning on/off core threads supported by the extension. If you have installed irqbalance package and turn off some cores you can get freezes or not working devices like wi-fi, bluetooth, video cards, sound cards...
  2. irqbalance is not a part of the Linux kernel.
  3. It designed for special server configurations with many RAID/HDD/SDD controllers.
  4. Only Debian Flowers have the irqbalance installed because Debian is very Server oriented. Red Hat doesn't have installed irqbalance by default but it doesn't make Red Hat less server OS.
  5. It keeps all Linux core threads working so its not good for power saving, especially for laptops.
  6. Any user-space application (like games, compilation...) can not get 100% of CPU resources on any thread because it's always sharing this resources with IO tasks. ...

Uninstall it and reboot your machine

sudo apt-get remove irqbalance
seb2411 commented 6 years ago

@konkor Thank you !

terencode commented 6 years ago

@konkor What about for a desktop with lots of cores and needs for real-time audio? (jack...)

konkor commented 6 years ago

@terencode lol I don't know :) But I know irqbalance on debian stretch from the kernel 4.9 and JACK worked since kernel 2x or 1x??? and works on single CPUs well so ;) Have you got some additional info?

terencode commented 6 years ago

@konkor did some researches and it's not recommended, thank you ;) Ok great I'll try to check it out and help you with what I can!

konkor commented 6 years ago

I want people to see this issue for while to help them...

alexeymuranov commented 6 years ago

Has there been some serious discussion somewhere about advantages and disadvantages of the irqbalance? Could you provide some links? I do not know enough to judge by myself, and it seems to be installed by default on Ubuntu, so i hesitate to remove it. Besides, it is being actively developed.

konkor commented 6 years ago

@alexeymuranov First of the all, IRQBALANCE doesn't support Core Threads ON/OFF Linux kernel feature and it can be a serious issue and can hung the system up easily. So it's not a red/critical warning and you can just ignore this warn and never turn OFF any core! So if my arguments there https://github.com/konkor/cpufreq/issues/48#issuecomment-345753362 are not enough we are open to discuss. I can't see any real reasons to use it on my desktop or laptop.

konkor commented 6 years ago

IRQBALANCE for the IO Priority and NOT FOR USER SPACE APPLICATIONS! Do you really want to have a system where you can't get any CPU Core Thread for your application? Where is IO Interruptions can interrupt any application everywhere? So do you think the IRQ handlers don't communicate with other kernel modules? Do you think it's possible or such communication between cores is free? So many of the IO devices are SLOW and have HUGE LATENCY.

UnconventionalMindset commented 6 years ago

Hi, I got the same issue with an HP OMEN 15-ce019na. The laptop has a i7 7700HQ and GTX1050Ti. I use it for work so I mainly run multiple applications (jetbrains IDEs, Postman, terminals, firefox and play music desktop player), however this laptop should be able those tasks pretty well and in fact it does good on windows and on Linux the fan doesn't spin much but still the extension shows a system loading of 180+% even if sometimes the frequency goes around 0.9 GHz - 1.5 Ghz mainly. I think there are some issues, either the drivers or the extension.

konkor commented 6 years ago

@JacopoGobbi So your issue is a high system loading? Actually, extension parsing /proc/loadavg kernel file stream and picks 1st value for 1 minute. You can google about it. I could recommend you check it manually in the terminal:

cat /proc/loadavg ## to check system loading values
sudo top ## to check top processes
sudo journalctl ## to check system messages
sudo journalctl -f ## to real-time monitor system messages

to find out of cause this issue. BTW gnome trackers/services/servers can do high loading on the start or on the writing activity.

konkor commented 6 years ago

@JacopoGobbi So I still prefer the acpi cpufreq mode to intel_pstate mode (Intel doesn't mean always good). You could try to disable intel_pstate mode in the kernel boot line. Second I recommend to disable turbo-boost and increase minimal frequency (25-30%) for productive profiles on laptops.

stuaxo commented 6 years ago

I'm pretty confused - I'd never heard of IRQBALANCE until I saw the big orange warning just now after installing cpufreq. I'm on a laptop so according to this thread I should uninstall it. TBH I don't care about threads getting interrupted for IO, I don't play games - just use a web browser and do software development. Further up it mentions servers with SSDs ... my laptop has an SSD and multiple threads.

Another page I saw said IRQBalance is good if on a laptop. At the very least, the orange warning could be a link to a wikipage with pros and cons.

konkor commented 6 years ago

@stuaxo 1) You can use irqbalance package but you aren't be able to turn off CPU Cores with the extension. Actually, you can but it could break/freeze your system. 2) many of IO Devices could be extremely slow in compression to CPU frequencies. ... Here is a small FAQ http://konkor.github.io/cpufreq/faq/#irqbalance-detected If you have pros and cons I could add them there :)

stuaxo commented 6 years ago

Thanks :)

I managed to lock up my computer (well it was sort of still running) just now when compiling a bunch of things, so the first thing I did when I came back was uninstall it. It's fairly new, so I'm not sure what's causing it, probably need more RAM...

This is the first I've heard of irqbalancer, so I was just wondering what it was when I saw the orange message.

stuaxo commented 6 years ago

Just noticed the message is still there even though I uninstalled it, I guess I need to reboot or something ?

konkor commented 6 years ago

@stuaxo yes, you have to reboot after uninstalling.

bidinou commented 6 years ago

Hi ! Is it possible to have an option in the extension to disable the warning ? :-) I decided I would stop messing with the defaults after 25 or so years of tweaking stuff :-), and as it's the default in the LTS version of the major distro, I'll keep it ;) Great extension BTW, thank you !

konkor commented 6 years ago

@bidinou Okay I could add that option in the next version

ayoungethan commented 5 years ago

I reported irqbalance as a bug when included by default in desktop images:

https://bugs.launchpad.net/ubuntu/+source/ubuntu-meta/+bug/1833322

DaVince commented 4 years ago

I've seen a few arguments for or against using irqbalance, but not much in the way of collaboration/discussion between the devs of irqbalance and GNOME cpufreq. Has there been any? Investigating possible performance issues together seems like a better idea than having to trust one single opinion on this.

konkor commented 4 years ago

@DaVince I didn't want to start Holy war about it. My first argument is the application doesn't work properly with enabled irqbalance. Second, powersaving. Third, performance related issues etc.

BTW: I'm pretty sure there are many cases where irqbalance could be very useful for server's tasks but not for Desktop usage and, especially, for laptop desktop users.

Linux is very servers oriented and any linux distros want to distribute several versions of kernels. So we all have to running a huge amount useless things for servers hardware, software, protocols and ms azure stacks etc and including irqbalance.

EDIT:

If you don't see 100% loading on CPU0 during your work-flow, you don't need to use irqbalance at all. Also the modern kernel is managing it itself depending on cpu0 loading.

konkor commented 4 years ago

GNU/Linux Debian (bug closing the issue) removed IRQBALANCE from dependencies. It means Ubuntu/PopOS/Mint and so on will do the same.

DaVince commented 4 years ago

Alright, thank you for digging up more widespread information about this. I will remove irqbalance now. :slightly_smiling_face: