Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
System starts lagging when switched to ondemand cpu governor
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
caaarlos
Apprentice
Apprentice


Joined: 27 Apr 2012
Posts: 155

PostPosted: Sat Aug 22, 2015 6:33 am    Post subject: System starts lagging when switched to ondemand cpu governor Reply with quote

Hello,

I'm traying to change my cpu governor from userspace to ondemand, I saw that it is better than userspace. But when I use ondemand (
Code:
for c in $(ls -d /sys/devices/system/cpu/cpu[0-9]*); do echo ondemand >$c/cpufreq/scaling_governor; done
) my system starts lagging. What should be my problem? What I have to do to fix it? Or isn't it error?

Thanks.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3707
Location: Hamburg

PostPosted: Sat Aug 22, 2015 8:19 am    Post subject: Reply with quote

Whilst ondemand was perfectly fine here for years I switched/added pstate in the mean while:
Code:
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_X86_INTEL_PSTATE=y
Maybe you can give that a try ?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Sat Aug 22, 2015 11:39 pm    Post subject: Reply with quote

I wonder why do not you use

cpupower frequency-set -g ondemand

also you need to set senseful values for the govenour influencing parameters in the kernel. when you have choosen not the right timing for the kernel lagging is guaranteed.

Code:
grep CONFIG_HZ /usr/src/linux/.config
# CONFIG_HZ_PERIODIC is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
CONFIG_HZ_300=y
# CONFIG_HZ_1000 is not set
CONFIG_HZ=300
Back to top
View user's profile Send private message
caaarlos
Apprentice
Apprentice


Joined: 27 Apr 2012
Posts: 155

PostPosted: Sun Aug 23, 2015 7:12 am    Post subject: Reply with quote

Thanks both of you for helping me,

toralf, I set ondemand as my default governor and added pstate, then I rebooted my system and no lags for now . What do you think that correct my problem? Setting ondemand as my default governor ou using pstate? And can you tell me what is pstate?

tw04l124, this is my kernel config:
Code:
grep CONFIG_HZ /usr/src/linux/.config
# CONFIG_HZ_PERIODIC is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000


Do I have to change my frequency to 300? I saw on the help menu that 1000 HZ is better for desktops. Is right? What this frequency means? Can you explain me?
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun Aug 23, 2015 7:17 am    Post subject: Reply with quote

1000 Hz is fine for a desktop, it has nothing to do with frequency scaling, though.
You should use pstate driver if your CPU supports it. You can see what's going on by running cpupower frequency-info.
Back to top
View user's profile Send private message
caaarlos
Apprentice
Apprentice


Joined: 27 Apr 2012
Posts: 155

PostPosted: Sun Aug 23, 2015 7:50 am    Post subject: Reply with quote

Buffoon, this is my output, sorry, but it is in portuguese. Can you udernstand it and explain me? I did not understante this information very well. I'm newby about harware...


Code:
# cpupower frequency-info
analisando o CPU 0:
  driver: acpi-cpufreq
  CPUs que rodam na mesma frequência de hardware: 0
  CPUs que precisam ter suas frequências coordenadas por software: 0
  maior latência de transição: 10.0 us.
  limites do hardware: 754 MHz - 2.60 GHz
  níveis de frequência disponíveis: 2.60 GHz, 2.60 GHz, 2.50 GHz, 2.30 GHz, 2.20 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 800 MHz, 754 MHz
  reguladores do cpufreq disponíveis: conservative, ondemand, powersave, userspace, performance
  política de frequência atual deve estar entre 754 MHz e 2.00 GHz.
                  O regulador "ondemand" deve decidir qual velocidade usar
                  dentro desse limite.
  frequência atual do CPU é 800 MHz (declarado por chamada ao hardware).
  boost state support:
    Supported: yes
    Active: yes
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun Aug 23, 2015 9:24 am    Post subject: Reply with quote

What CPU is this.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Sun Aug 23, 2015 11:23 am    Post subject: Reply with quote

afaik 300 hz useful for odler boxes with multimedia. but please read the kernel info in kernel itself.

you may try using cpupower and see if that solves your issue.

if not you may set the frequency to a fixed value when you are using ac power.

you may also consider using a slim desctop like i3wm for example which will give you back some ressources in comparision to the bloated desctops like ... "kde / gnome" ...

you may check out the kernel and tweak it a bit to see if it gets better.

you may also consider buying one ssd for your / which should speed up things too. i use 128GB ssd here which i bought years ago and it works fine. you can move the distfiles to another drive (ordinary hdd) to have more useful space on /.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum