Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] New System has some Desktop Lag
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 727

PostPosted: Sat Jul 21, 2018 9:47 pm    Post subject: [SOLVED] New System has some Desktop Lag Reply with quote

On a new Gentoo system (Intel Core i9) I am having occasional lag/unresponsiveness in my desktop (OpenBox) when moving windows. Also sometimes music that I am playing stutters. This only seems to happen when the system is almost idle. (When all the cores are busy, say emerging a package, I can move windows around without issue and no music stuttering.)

EDIT: I want to emphasize that this issue ONLY occurs when the system has no or low load.

I thought there may be a kernel issue (I copied a kernel configuration from an old Intel Core i7 without this issue). I made the following changes, rebooted and have the same issue:

CONFIG_PREEMPT_NONE=y -> CONFIG_PREEMPT_VOLUNTARY=y

CONFIG_HZ_300=y -> CONFIG_HZ_1000=y

I am using the ONDEMAND freq. governor.

Any suggestions on vanquishing this lag?


Last edited by jagdpanther on Sun Jul 22, 2018 4:04 pm; edited 2 times in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sat Jul 21, 2018 10:42 pm    Post subject: Reply with quote

You should use pstates driver with this CPU.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 727

PostPosted: Sat Jul 21, 2018 11:10 pm    Post subject: Reply with quote

Quote:
You should use pstates driver with this CPU


Thanks. However, pstste is already enabled:

Code:
# CPU frequency scaling drivers
#
CONFIG_X86_INTEL_PSTATE=y
# CONFIG_X86_PCC_CPUFREQ is not set
CONFIG_X86_ACPI_CPUFREQ=y
# CONFIG_X86_ACPI_CPUFREQ_CPB is not set
# CONFIG_X86_POWERNOW_K8 is not set
# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
# CONFIG_X86_P4_CLOCKMOD is not set
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sat Jul 21, 2018 11:51 pm    Post subject: Reply with quote

Code:
cpupower frequency-info

There is no governor called ondemand with pstates, although it works the same way. Make sure pstates is actually in use. And with such a new CPU I'd say use the latest kernel, currently 4.17.8.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1141
Location: Romania

PostPosted: Sat Jul 21, 2018 11:56 pm    Post subject: Re: New System has some Desktop Lag Reply with quote

jagdpanther wrote:
Also sometimes music that I am playing stutters.


I'm guessing it's hda adaptor and it should have CONFIG_SND_HDA_PREALLOC_SIZE=2048

just a guess. for sound. for i9... don't know.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sun Jul 22, 2018 12:28 am    Post subject: Reply with quote

CONFIG_PREEMPT_VOLUNTARY=y is an odd choice for a top-end desktop CPU. Why not full preempt?
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 727

PostPosted: Sun Jul 22, 2018 1:28 am    Post subject: Reply with quote

Jaglover:
Quote:
There is no governor called ondemand with pstates, although it works the same way. Make sure pstates is actually in use. And with such a new CPU I'd say use the latest kernel, currently 4.17.8.


I guess I selected ondemand as the default governor in my kernel configuration. I'll change the default to powersave. That probably won't matter using pstate.

Code:
 # cpupower frequency-info
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 1.20 GHz - 4.40 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 1.20 GHz and 4.40 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.20 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes


Code:
 uname -r
4.17.8-gentoo-02

The trailing number (-02, here) is how I get more than one kernel of the same version with different configurations.


axl:

Thanks, for the tip. I already have that set:
Code:
CONFIG_SND_HDA_PREALLOC_SIZE=2048


Ant P.:
Until today I have used the following without issue. (On i7 systems not a new i9):
Code:
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set


I'll give CONFIG_PREEMPT a try when I am done with this post.
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 727

PostPosted: Sun Jul 22, 2018 2:03 am    Post subject: Reply with quote

re-configured and compiled kernel, 4.17.8-gentoo ...

Code:
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y


PREEMPT makes no difference. The really strange issue is that when the system is under load there is no desktop lagging or unresponsiveness and audio is perfect. This issue happens when the system is NOT loaded. There does not appear to be any errors in /var/log/messages.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sun Jul 22, 2018 2:55 am    Post subject: Reply with quote

That sounds very similar to a bug I've seen in old (~10yr) CPUs I have, but fixing it was just a matter of turning off a BIOS power saving option. Probably wouldn't work here.


The only other thing I can think of is that the kernel picked a bad default timer, try changing the current_clocksource value in /sys/devices/system/clocksource.
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 727

PostPosted: Sun Jul 22, 2018 3:53 am    Post subject: Reply with quote

Ant P. :

Thank you.

Quote:
The only other thing I can think of is that the kernel picked a bad default timer, try changing the current_clocksource value in /sys/devices/system/clocksource.


After reading /usr/src/linux/Documentation/admin-guide/kernel-parameters, https://access.redhat.com/solutions/18627 and https://unix.stackexchange.com/questions/164512/what-does-the-change-of-the-clocksource-influence, I see on my system:

Code:
cd /sys/devices/system/clocksource/clocksource0
$ cat current_clocksource
tsc
$ cat available_clocksource
tsc hpet acpi_pm


Somewhere in that reading is a comment about acpi... being a last resort so I did the following from the same location:

Code:
# echo "hpet" > current_clocksource
# cat current_clocksource
hpet


So far all the lagging and audio stuttering has gone away. (Both when the system is loaded and unloaded.)

What is the "proper" way in Gentoo of making that change permanent? (I could put a one liner in /etc/local.d/.... .start)
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Jul 22, 2018 8:11 am    Post subject: Reply with quote

clocksource=hpet in kernel command line is one way to do it.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 727

PostPosted: Sun Jul 22, 2018 4:05 pm    Post subject: Reply with quote

Switching the clocksource from tsc to hpet solved the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments 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