Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Experemental] CPU Power Control ready for testing #19

Closed
konkor opened this issue Apr 24, 2017 · 21 comments
Closed

[Feature Experemental] CPU Power Control ready for testing #19

konkor opened this issue Apr 24, 2017 · 21 comments

Comments

@konkor
Copy link
Owner

konkor commented Apr 24, 2017

Summer is coming. So Linux powered users should be ready for summer heat) Well, if you have tens CPU cores on your laptop or PC you can just tune off them from our gnome extension now.
Here is some screenshots to understand what it is:
screenshot from 2017-04-24 10 15 05
screenshot from 2017-04-24 10 16 15
screenshot from 2017-04-24 10 17 15
So if you'll make some benchmarks for system performance or battery usage I'll be glad to see them here.

PS: This technique is using widely on Android platform to dramatically reducing of power consuming. They have dynamic power managers which control this CPU state based on system loading.

@RicardoEPRodrigues
Copy link
Contributor

I'm sorry to inform that changing the active CPU now freezes my system. I don't know what the problem is.

I have Intel CPU.

Is there logs I can check after reboot?

@konkor
Copy link
Owner Author

konkor commented Apr 25, 2017

@RicardoEPRodrigues it seems like this feature is experimental... Some questions:

  1. You said 'now' so why now? Any idea?
  2. CPU 0 is always on bcs Linux kernel there.
  3. Some most apps don't support properly this feature and can be a cause of the freezing.
  4. The extension doesn't do nothing bad it's off through the kernel so it can't be kernel a cause of your freeze.
  5. If we want using this ability of Linux kernel like Android using we have to report about this bugs to Developers.
  6. I didn't test well too. I didn't test with Virtual machine and many other software.
    I have been testing too on 2 Intel machines and never had cold freezes yet. But i tested on Debian stable.
    Some advice about it. Off CPU cores in row from the end like 111000 and not 0101001. Bcs too many software using CPUs in row to example even gnome-system-monitor can't detect properly CPUs. If you want to use it try reduce CPU count on early start up.
    Maybe I should reduce CPU count by extension through the Slider to avoid random CPU states. But anyway it can't work well without proper apps support. So we have to ask devs for supporting this kernel feature!!!

@konkor
Copy link
Owner Author

konkor commented Apr 25, 2017

About system logs:

  1. On Debian based systems u can find ur logs at /var/log/syslog ... .1, .2.gz...
  2. If you have System D only # journalctl -b -1
    If you see nothing you have to enable past boots savings:
    (https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs)
Past Boots

While you will commonly want to display the information from the current boot, there are certainly times when past boots would be helpful as well. The journal can save information from many previous boots, so journalctl can be made to display information easily.

Some distributions enable saving previous boot information by default, while others disable this feature. To enable persistent boot information, you can either create the directory to store the journal by typing:

    sudo mkdir -p /var/log/journal

Or you can edit the journal configuration file:

    sudo nano /etc/systemd/journald.conf

Under the [Journal] section, set the Storage= option to "persistent" to enable persistent logging:
/etc/systemd/journald.conf

. . .
[Journal]
Storage=persistent

When saving previous boots is enabled on your server, journalctl provides some commands to help you work with boots as a unit of division. To see the boots that journald knows about, use the --list-boots option with journalctl:

journalctl --list-boots

-2 caf0524a1d394ce0bdbcff75b94444fe Tue 2015-02-03 21:48:52 UTC—Tue 2015-02-03 22:17:00 UTC
-1 13883d180dc0420db0abcb5fa26d6198 Tue 2015-02-03 22:17:03 UTC—Tue 2015-02-03 22:19:08 UTC
 0 bed718b17a73415fade0e4e7f4bea609 Tue 2015-02-03 22:19:12 UTC—Tue 2015-02-03 23:01:01 UTC

This will display a line for each boot. The first column is the offset for the boot that can be used to easily reference the boot with journalctl. If you need an absolute reference, the boot ID is in the second column. You can tell the time that the boot session refers to with the two time specifications listed towards the end.

To display information from these boots, you can use information from either the first or second column.

For instance, to see the journal from the previous boot, use the -1 relative pointer with the -b flag:

journalctl -b -1

You can also use the boot ID to call back the data from a boot:

journalctl -b caf0524a1d394ce0bdbcff75b94444fe

@konkor konkor changed the title [Feature] CPU Power Control ready for testing [Feature Experemental] CPU Power Control ready for testing Apr 25, 2017
@RicardoEPRodrigues
Copy link
Contributor

I said now because before #20 it worked, yet it may not be related at all.

My machine has always had problem with Linux, it's a MSI GS70 Stealth Pro and it always gave problems with Linux... I really want to sell this s**t.

So maybe the problem isn't related with this app and more related with the PC freaking out when I try to do anything...

I'll try to get the logs after the freeze.


For anyone with this issue (hope it's only me) after reboot I had to remove extension completely before logging into GNOME.

Steps:

Ctrl+Alt+F3
Login
rm -rf ~/.local/share/gnome-shell/extensions/cpufreq@konkor
Ctrl+Alt+F1

@konkor
Copy link
Owner Author

konkor commented Apr 26, 2017

@RicardoEPRodrigues Unfortunately most laptops have weak/small/bad cooling system. I'd recommend you to monitor your temperature sensors for CPU and GPU they are a cause of the most laptop problems. Second problem can be with RAM and/or HDDs you can test them by software or the best way it's temporary replacement and test them (to test RAM u can remove 1 by 1 or memory cards if u have got a few; to test HDD run ur system from flash or external drive for while). 3d basic problem is power supply issues.
Did you see this article http://www.phoronix.com/scan.php?page=article&item=linux-47-schedutil&num=2
'Intel pstate' mode is not always the best choice. You could try it easy https://github.com/konkor/cpufreq#how-to-disable--intel-pstate-driver
PS: I didn't test intel pstate mode well last time bcs i have only 1 remote machine for the tests.

@RicardoEPRodrigues
Copy link
Contributor

Most of my issues are driver based, where the hardware is fine, but it is not compatible with Linux.

For example, when I first bought it, to even be able to boot an Ubuntu 15.10 pen I had to add intel_idle.max_cstate=1 to boot options.

Now (2 years later) for Ubuntu 17.04 I had to add neoveou.modeset=0.

Everytime I boot GNOME a message pops up saying there was an error.

This computer always gave problems with Linux.

@konkor
Copy link
Owner Author

konkor commented Apr 27, 2017

@RicardoEPRodrigues you need time and you find your own way in Linux. I had a lot problems too. I had tried/changed a lot distros for 15+ years of my Linux experience. But now I'm on Debian stable (Jessie) and looking at Debian Stretch. You can easy try Debian Stretch it's RCx now and in few weeks/month will be next stable release. I don't have nvidia errors in my logs and after each update it's going to be only more stable without any breaks. And now with flatpacks, virtual machines and nice hardware it's no any problem to do any task u want. Ubuntu is based on Debian so u can easy use PPA/Wiki/Packages... So I'd recommend you to have extra/emergency partition with what do u want for tests, recovery or just for fun. But It's just my opinion... I like to have thousands distributions of Linux to have alternatives and ideas and so.

@RicardoEPRodrigues
Copy link
Contributor

I have a fresh install of Ubuntu GNOME 17.04, I'll boot it and give it a go. If it breaks I'll let you know.

Thank you for your insight. I would really love to buy a System76 laptop (or a Dell Developer edition) that way I am sure the hardware is supported by the Linux Kernel and if any problems arise I can complain with the company. 😄

@RicardoEPRodrigues
Copy link
Contributor

It seems that my computer is just crazy. Now I can disable CPU's without a problem.

If no problem surges I think you can push this to gnome.extensions if you haven't already.

konkor added a commit that referenced this issue Apr 27, 2017
@RicardoEPRodrigues
Copy link
Contributor

Hello again, I found an issue that I'd hope happens to more people than just me.

Basically if I disable cores my wifi stops working until I disable and enable the wifi connection.

You mentioned that some programs could not be looking into what cores are active and that could generate issues. I think this is one big one.

I'm using Ubuntu GNOME 17.04 with the default kernel 4.10.0-20-generic.

@konkor
Copy link
Owner Author

konkor commented May 4, 2017

Sorry to hear that. I have tried on Dell Broadcom and Toshiba Atheros WiFi and all is just fine. I'll try Ubuntu GNOME 17.04 live-cd for you. You could report a bug to ur wifi driver devs and try live-cd with some other distro like Debian Live or Fedora 25/26...

@RicardoEPRodrigues
Copy link
Contributor

I'll try a Fedora live-usb to test it out when I can. If the wifi works there and not on Ubuntu I'll report it to the devs.

@konkor
Copy link
Owner Author

konkor commented May 4, 2017

@RicardoEPRodrigues I tried Ubuntu 17.04 and got some logs:

May 04 14:32:46 ubuntu-gnome kernel: Broke affinity for irq 16
May 04 14:32:46 ubuntu-gnome kernel: Broke affinity for irq 30
May 04 14:32:46 ubuntu-gnome kernel: Broke affinity for irq 31
May 04 14:32:55 ubuntu-gnome /usr/sbin/irqbalance[1548]: WARNING, didn't collect load info for all cpus, balancing is broken

It's looking like this irqbalance could be a cause of ur WiFi issue. It's not a default kernel module or something... So just try to uninstall this package, restart and try again. Many people are disabling it for years.

I think this tool could be useful for some virtual hosters providers or for real multi sockets platforms...

@konkor
Copy link
Owner Author

konkor commented May 4, 2017

@RicardoEPRodrigues so I didn't have issue even with this irqbalance errors but if it's working dynamically it maybe just a luck.
So 1 thing more Is This issue happen only once? Bcs I see irqbalance stoped working after 1st disabling...

@RicardoEPRodrigues
Copy link
Contributor

I have to test that out.

The issue happens only once, yes, meaning that when I turn off cores, the wifi freaks out, I reboot the wifi and then it works fine.

@konkor
Copy link
Owner Author

konkor commented May 4, 2017

So did you remove this package?

@RicardoEPRodrigues
Copy link
Contributor

Not yet. When I do, I'll let you know. 😃

@konkor
Copy link
Owner Author

konkor commented May 4, 2017

Don't worry. No main distributions have this package. You could reinstall it after tests.

@RicardoEPRodrigues
Copy link
Contributor

Removing the package solved the issue! Thank you! 😄

@konkor
Copy link
Owner Author

konkor commented May 5, 2017

@RicardoEPRodrigues Glad to hear that. Feel free to report this bug to irqbalance devs and to the Ubuntu package maintainers (or/and Ubuntu Gnome to remove this package from default install).
I can only imaging where this package could improve something. Because the Linux kernel has own balancers for the kernel jobs. And outside balancers could make things worst... It's look like a temporary solution for some big Servers with tens+ IO raid controllers and/or VM hosters. You don't need it on ur laptop or desktop for sure. Let to Linux kernel manage it.

@RicardoEPRodrigues
Copy link
Contributor

I think we can close this issue too. Since it was shipped with the last update, right?

@konkor konkor closed this as completed May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants